Skip to content

Commit 51dc344

Browse files
Update clippy book to mention cfg(clippy) instead of feature cargo-clippy
1 parent 46c88ee commit 51dc344

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

book/src/configuration.md

+3-6
Original file line numberDiff line numberDiff line change
@@ -113,17 +113,14 @@ found [here](https://rust-lang.github.io/rust-clippy/master/index.html#msrv)
113113
114114
Very rarely, you may wish to prevent Clippy from evaluating certain sections of code entirely. You can do this with
115115
[conditional compilation](https://doc.rust-lang.org/reference/conditional-compilation.html) by checking that the
116-
`cargo-clippy` feature is not set. You may need to provide a stub so that the code compiles:
116+
`clippy` cfg is not set. You may need to provide a stub so that the code compiles:
117117

118118
```rust
119-
#[cfg(not(feature = "cargo-clippy"))]
119+
#[cfg(not(clippy)]
120120
include!(concat!(env!("OUT_DIR"), "/my_big_function-generated.rs"));
121121

122-
#[cfg(feature = "cargo-clippy")]
122+
#[cfg(clippy)]
123123
fn my_big_function(_input: &str) -> Option<MyStruct> {
124124
None
125125
}
126126
```
127-
128-
This feature is not actually part of your crate, so specifying `--all-features` to other tools, e.g. `cargo test
129-
--all-features`, will not disable it.

0 commit comments

Comments
 (0)