File tree 1 file changed +16
-1
lines changed 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ define the `CLIPPY_DISABLE_DOCS_LINKS` environment variable.
104
104
105
105
### Allowing/denying lints
106
106
107
- You can add options to ` allow ` /` warn ` /` deny ` :
107
+ You can add options to your code to ` allow ` /` warn ` /` deny ` Clippy lints :
108
108
109
109
* the whole set of ` Warn ` lints using the ` clippy ` lint group (` #![deny(clippy::all)] ` )
110
110
@@ -118,6 +118,21 @@ You can add options to `allow`/`warn`/`deny`:
118
118
119
119
Note: ` deny ` produces errors instead of warnings.
120
120
121
+ Note: To use the new ` clippy::lint_name ` syntax, ` #![feature(tool_lints)] ` has to be activated
122
+ currently. If you want to compile your code with the stable toolchain you can use a ` cfg_attr ` to
123
+ activate the ` tool_lints ` feature:
124
+ ``` rust
125
+ #![cfg_attr(feature = " cargo-clippy" , feature(tool_lints))]
126
+ #![cfg_attr(feature = " cargo-clippy" , allow(clippy:: lint_name))]
127
+ ```
128
+
129
+ For this to work you have to use Clippy on the nightly toolchain: ` cargo +nightly clippy ` . If you
130
+ want to use Clippy with the stable toolchain, you can stick to the old unscoped method to
131
+ enable/disable Clippy lints until ` tool_lints ` are stable:
132
+ ``` rust
133
+ #![cfg_attr(feature = " cargo-clippy" , allow(clippy_lint))]
134
+ ```
135
+
121
136
## Updating rustc
122
137
123
138
Sometimes, rustc moves forward without Clippy catching up. Therefore updating
You can’t perform that action at this time.
0 commit comments