diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2024-02-14 23:18:17 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2024-02-15 11:52:53 +0100 |
| commit | f4a3db8e4e40c075bce4a4e141becd41c2e0b1fa (patch) | |
| tree | 39b63314e48225661a4fc2cc76b984a29b1e2a00 | |
| parent | cd6f03a3e82af4f50f6ebf68afdd13957dca3eb3 (diff) | |
| download | rust-f4a3db8e4e40c075bce4a4e141becd41c2e0b1fa.tar.gz rust-f4a3db8e4e40c075bce4a4e141becd41c2e0b1fa.zip | |
Update clippy book to mention `cfg(clippy)` instead of feature `cargo-clippy`
| -rw-r--r-- | book/src/configuration.md | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/book/src/configuration.md b/book/src/configuration.md index e8274bc4575..05520346456 100644 --- a/book/src/configuration.md +++ b/book/src/configuration.md @@ -113,17 +113,14 @@ found [here](https://rust-lang.github.io/rust-clippy/master/index.html#msrv) Very rarely, you may wish to prevent Clippy from evaluating certain sections of code entirely. You can do this with [conditional compilation](https://doc.rust-lang.org/reference/conditional-compilation.html) by checking that the -`cargo-clippy` feature is not set. You may need to provide a stub so that the code compiles: +`clippy` cfg is not set. You may need to provide a stub so that the code compiles: ```rust -#[cfg(not(feature = "cargo-clippy"))] +#[cfg(not(clippy)] include!(concat!(env!("OUT_DIR"), "/my_big_function-generated.rs")); -#[cfg(feature = "cargo-clippy")] +#[cfg(clippy)] fn my_big_function(_input: &str) -> Option<MyStruct> { None } ``` - -This feature is not actually part of your crate, so specifying `--all-features` to other tools, e.g. `cargo test ---all-features`, will not disable it. |
