Skip to content

Commit 257fa44

Browse files
authored
Merge pull request #3571 from Feriixu/patch-1
Fix typo: Replace `unsafe` with `unsafe_code`, because `unsafe` is not a lint.
2 parents 017edf5 + 56ca413 commit 257fa44

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

text/3389-manifest-lint.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ rustc and other tool lints.
1313
[motivation]: #motivation
1414

1515
Currently, you can configure lints through
16-
- `#[<level>(<lint>)]` or `#![<level>(<lint>)]`, like `#[forbid(unsafe)]`
16+
- `#[<level>(<lint>)]` or `#![<level>(<lint>)]`, like `#[forbid(unsafe_code)]`
1717
- But this doesn't scale up with additional targets (benches, examples,
1818
tests) or workspaces
19-
- On the command line, like `cargo clippy -- --forbid unsafe`
19+
- On the command line, like `cargo clippy -- --forbid unsafe_code`
2020
- This puts the burden on the caller
21-
- Through `RUSTFLAGS`, like `RUSTFLAGS=--forbid=unsafe cargo clippy`
21+
- Through `RUSTFLAGS`, like `RUSTFLAGS=--forbid=unsafe_code cargo clippy`
2222
- This puts the burden on the caller
2323
- In `.cargo/config.toml`'s `target.*.rustflags`
2424
- This couples you to the running in specific directories and not running in
@@ -41,7 +41,7 @@ See also
4141
A new `lints` table would be added to configure lints:
4242
```toml
4343
[lints.rust]
44-
unsafe = "forbid"
44+
unsafe_code = "forbid"
4545
```
4646
and `cargo` would pass these along as flags to `rustc`, `clippy`, or other lint tools.
4747

@@ -52,7 +52,7 @@ This would work with
5252
workspace = true
5353

5454
[workspace.lints.rust]
55-
unsafe = "forbid"
55+
unsafe_code = "forbid"
5656
```
5757

5858
## Documentation Updates
@@ -65,13 +65,13 @@ Override the default level of lints from different tools by assigning them to a
6565
table, for example:
6666
```toml
6767
[lints.rust]
68-
unsafe = "forbid"
68+
unsafe_code = "forbid"
6969
```
7070

7171
This is short-hand for:
7272
```toml
7373
[lints.rust]
74-
unsafe = { level = "forbid", priority = 0 }
74+
unsafe_code = { level = "forbid", priority = 0 }
7575
```
7676

7777
`level` corresponds to the lint levels in `rustc`:
@@ -87,7 +87,7 @@ unsafe = { level = "forbid", priority = 0 }
8787

8888
To know which table under `[lints]` a particular lint belongs under, it is the part before `::` in the lint
8989
name. If there isn't a `::`, then the tool is `rust`. For example a warning
90-
about `unsafe` would be `lints.rust.unsafe` but a lint about
90+
about `unsafe_code` would be `lints.rust.unsafe_code` but a lint about
9191
`clippy::enum_glob_use` would be `lints.clippy.enum_glob_use`.
9292

9393
## The `lints` table
@@ -106,7 +106,7 @@ Example:
106106
members = ["crates/*"]
107107

108108
[workspace.lints.rust]
109-
unsafe = "forbid"
109+
unsafe_code = "forbid"
110110
```
111111

112112
```toml

0 commit comments

Comments
 (0)