@@ -13,12 +13,12 @@ rustc and other tool lints.
1313[ motivation ] : #motivation
1414
1515Currently, 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
4141A new ` lints ` table would be added to configure lints:
4242``` toml
4343[lints .rust ]
44- unsafe = " forbid"
44+ unsafe_code = " forbid"
4545```
4646and ` cargo ` would pass these along as flags to ` rustc ` , ` clippy ` , or other lint tools.
4747
@@ -52,7 +52,7 @@ This would work with
5252workspace = 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
6565table, for example:
6666``` toml
6767[lints .rust ]
68- unsafe = " forbid"
68+ unsafe_code = " forbid"
6969```
7070
7171This 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
8888To know which table under ` [lints] ` a particular lint belongs under, it is the part before ` :: ` in the lint
8989name. 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:
106106members = [" crates/*" ]
107107
108108[workspace .lints .rust ]
109- unsafe = " forbid"
109+ unsafe_code = " forbid"
110110```
111111
112112``` toml
0 commit comments