Skip to content

Commit f65c938

Browse files
Add missing copyright headers and audit instructions (#2795)
* Add missing copyright headers and audit instructions * Update UI test stderr files following copyright header addition * Add missing copyright headers and audit instructions (rebased) --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: Joshua Liebow-Feeser <[email protected]>
1 parent cd0dcd0 commit f65c938

File tree

7 files changed

+57
-20
lines changed

7 files changed

+57
-20
lines changed

.gemini/styleguide.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
<!-- Copyright 2025 The Fuchsia Authors
2+
3+
Licensed under a BSD-style license <LICENSE-BSD>, Apache License, Version 2.0
4+
<LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0>, or the MIT
5+
license <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your option.
6+
This file may not be copied, modified, or distributed except according to
7+
those terms. -->
8+
19
# Coding Guidelines
210

311
Please follow the development instructions and coding guidelines defined in `AGENTS.md` located in the root of this repository.

.vscode/settings.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
// Copyright 2025 The Fuchsia Authors
2+
//
3+
// Licensed under a BSD-style license <LICENSE-BSD>, Apache License, Version 2.0
4+
// <LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0>, or the MIT
5+
// license <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your option.
6+
// This file may not be copied, modified, or distributed except according to
7+
// those terms.
8+
19
{
210
// Extra cfgs added to rust-analyzer.
311
"rust-analyzer.cargo.cfgs": [

AGENTS.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
<!-- Copyright 2025 The Fuchsia Authors
2+
3+
Licensed under a BSD-style license <LICENSE-BSD>, Apache License, Version 2.0
4+
<LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0>, or the MIT
5+
license <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your option.
6+
This file may not be copied, modified, or distributed except according to
7+
those terms. -->
8+
19
# Development Instructions
210

311
This repository uses a wrapper script around Cargo to ensure consistent toolchain usage and configuration.
@@ -76,6 +84,10 @@ When a PR makes progress on, but does not close, an issue, the PR description an
7684

7785
## Code Style
7886

87+
### File Headers
88+
89+
Each file should contain a copyright header (excluding auto-generated files such as `.stderr` files). The header should follow the format found in existing files (e.g. `src/lib.rs`), using the appropriate comment syntax for the file type.
90+
7991
### Formatting
8092

8193
To determine how to format code, read the formatting checker script in `ci/check_fmt.sh`.
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
error[E0623]: lifetime mismatch
2-
--> tests/ui-msrv/ptr-is-invariant-over-v.rs:10:14
2+
--> tests/ui-msrv/ptr-is-invariant-over-v.rs:19:14
33
|
4-
7 | big: Ptr<'small, &'big u32, (Exclusive, Aligned, Valid)>,
4+
16 | big: Ptr<'small, &'big u32, (Exclusive, Aligned, Valid)>,
55
| --------------------------------------------------- these two types are declared with different lifetimes...
66
...
7-
10 | _small = big;
7+
19 | _small = big;
88
| ^^^ ...but data from `big` flows into `big` here
99

1010
error[E0623]: lifetime mismatch
11-
--> tests/ui-msrv/ptr-is-invariant-over-v.rs:17:14
11+
--> tests/ui-msrv/ptr-is-invariant-over-v.rs:26:14
1212
|
13-
14 | big: Ptr<'small, &'big u32, (Shared, Aligned, Valid)>,
13+
23 | big: Ptr<'small, &'big u32, (Shared, Aligned, Valid)>,
1414
| ------------------------------------------------ these two types are declared with different lifetimes...
1515
...
16-
17 | _small = big;
16+
26 | _small = big;
1717
| ^^^ ...but data from `big` flows into `big` here

tests/ui-nightly/ptr-is-invariant-over-v.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
// Copyright 2025 The Fuchsia Authors
2+
//
3+
// Licensed under the 2-Clause BSD License <LICENSE-BSD or
4+
// https://opensource.org/license/bsd-2-clause>, Apache License, Version 2.0
5+
// <LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0>, or the MIT
6+
// license <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your option.
7+
// This file may not be copied, modified, or distributed except according to
8+
// those terms.
9+
110
use zerocopy::pointer::{
211
invariant::{Aligned, Exclusive, Shared, Valid},
312
Ptr,

tests/ui-nightly/ptr-is-invariant-over-v.stderr

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
error: lifetime may not live long enough
2-
--> tests/ui-nightly/ptr-is-invariant-over-v.rs:10:5
3-
|
4-
6 | fn _when_exclusive<'big: 'small, 'small>(
2+
--> tests/ui-nightly/ptr-is-invariant-over-v.rs:19:5
3+
|
4+
15 | fn _when_exclusive<'big: 'small, 'small>(
55
| ---- ------ lifetime `'small` defined here
66
| |
77
| lifetime `'big` defined here
88
...
9-
10 | _small = big;
9+
19 | _small = big;
1010
| ^^^^^^^^^^^^ assignment requires that `'small` must outlive `'big`
1111
|
1212
= help: consider adding the following bound: `'small: 'big`
@@ -15,14 +15,14 @@ error: lifetime may not live long enough
1515
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
1616

1717
error: lifetime may not live long enough
18-
--> tests/ui-nightly/ptr-is-invariant-over-v.rs:17:5
18+
--> tests/ui-nightly/ptr-is-invariant-over-v.rs:26:5
1919
|
20-
13 | fn _when_shared<'big: 'small, 'small>(
20+
22 | fn _when_shared<'big: 'small, 'small>(
2121
| ---- ------ lifetime `'small` defined here
2222
| |
2323
| lifetime `'big` defined here
2424
...
25-
17 | _small = big;
25+
26 | _small = big;
2626
| ^^^^^^^^^^^^ assignment requires that `'small` must outlive `'big`
2727
|
2828
= help: consider adding the following bound: `'small: 'big`

tests/ui-stable/ptr-is-invariant-over-v.stderr

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
error: lifetime may not live long enough
2-
--> tests/ui-stable/ptr-is-invariant-over-v.rs:10:5
3-
|
4-
6 | fn _when_exclusive<'big: 'small, 'small>(
2+
--> tests/ui-stable/ptr-is-invariant-over-v.rs:19:5
3+
|
4+
15 | fn _when_exclusive<'big: 'small, 'small>(
55
| ---- ------ lifetime `'small` defined here
66
| |
77
| lifetime `'big` defined here
88
...
9-
10 | _small = big;
9+
19 | _small = big;
1010
| ^^^^^^^^^^^^ assignment requires that `'small` must outlive `'big`
1111
|
1212
= help: consider adding the following bound: `'small: 'big`
@@ -15,14 +15,14 @@ error: lifetime may not live long enough
1515
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
1616

1717
error: lifetime may not live long enough
18-
--> tests/ui-stable/ptr-is-invariant-over-v.rs:17:5
18+
--> tests/ui-stable/ptr-is-invariant-over-v.rs:26:5
1919
|
20-
13 | fn _when_shared<'big: 'small, 'small>(
20+
22 | fn _when_shared<'big: 'small, 'small>(
2121
| ---- ------ lifetime `'small` defined here
2222
| |
2323
| lifetime `'big` defined here
2424
...
25-
17 | _small = big;
25+
26 | _small = big;
2626
| ^^^^^^^^^^^^ assignment requires that `'small` must outlive `'big`
2727
|
2828
= help: consider adding the following bound: `'small: 'big`

0 commit comments

Comments
 (0)