Skip to content

Commit f56b2c6

Browse files
committed
Address review comments
1 parent ac34cfa commit f56b2c6

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

posts/2024-02-16-Clippy-deprecating-feature-cargo-clippy.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ release: true
66
---
77

88
Since Clippy [`v0.0.97`] and before it was shipped with `rustup`, Clippy
9-
implicitly added a `feature = "cargo-clippy"`[^1] when linting your code with
10-
`cargo clippy`.
9+
implicitly added a `feature = "cargo-clippy"` config[^1] when linting your code
10+
with `cargo clippy`.
1111

1212
[^1]: It's likely, that you didn't even know that Clippy implicitly sets this
13-
feature. This is intentional, as we stopped advertising and documenting this
14-
a long time ago.
13+
config (which was not a Cargo feature). This is intentional, as we stopped
14+
advertising and documenting this a long time ago.
1515

1616
Back in the day (2016) this was necessary to allow, warn or deny lints with
1717
attributes:
@@ -65,23 +65,25 @@ taking this opportunity to transition to [setting lint levels in
6565

6666
## Motivation for Deprecation
6767

68-
There's a plan to stabilize [checking conditional compilation at compile
69-
time][rfc-3013], aka `cargo check -Zcheck-cfg`. If we were to keep `feature =
70-
"cargo-clippy"`, users would start seeing a lot of warnings when running `cargo
71-
clippy`. To work around this, they would have to add a dummy feature to their
72-
`Cargo.toml` in order to silence those warnings:
68+
Currently, there's a [call for testing], in order to stabilize [checking
69+
conditional compilation at compile time][rfc-3013], aka `cargo check
70+
-Zcheck-cfg`. If we were to keep the `feature = "cargo-clippy"` config, users
71+
would start seeing a lot of warnings when running `cargo clippy`. To work around
72+
this, they would have to add a dummy feature to their `Cargo.toml` in order to
73+
silence those warnings:
7374

7475
```toml
7576
[features]
7677
cargo-clippy = []
7778
```
7879

7980
We didn't think this would be user friendly and decided, that we want to
80-
deprecate the implicit `feature = "cargo-clippy"` and replace it with
81-
`cfg(clippy)` instead.
81+
deprecate the implicit `feature = "cargo-clippy"` config and replace it with the
82+
`clippy` config instead.
8283

8384
[`v0.0.97`]: https://github.com/rust-lang/rust-clippy/blob/61daf674eaf17f3b504c51f01b4ee63fac47dfcf/CHANGELOG.md?plain=0#0097--2016-11-03
8485
[rfc-3013]: https://github.com/rust-lang/rfcs/pull/3013
8586
[use case]: https://doc.rust-lang.org/clippy/configuration.html#disabling-evaluation-of-certain-code
8687
[pr-12292]: https://github.com/rust-lang/rust-clippy/pull/12292
8788
[cargo-lints]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-lints-section
89+
[call for testing]: https://github.com/rust-lang/rfcs/pull/3013#issuecomment-1936648479

0 commit comments

Comments
 (0)