mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
e930ea274e
Fix invalid check-cfg Cargo feature diagnostic help #118213 added specialized diagnostic for Cargo `feature` cfg. However when providing an empty `#[cfg(feature)]` condition the suggestion would suggest adding `feature` as a feature in `Cargo.toml` (wtf!). This PR removes the invalid logic, which even brings a nice improvement. ```diff --> $DIR/cargo-feature.rs:18:7 | LL | #[cfg(feature)] - | ^^^^^^^ + | ^^^^^^^- help: specify a config value: `= "bitcode"` | = note: expected values for `feature` are: `bitcode` - = help: consider defining `feature` as feature in `Cargo.toml` ``` The first commit add a test showing the bug and the second commit fixes the bug. `@rustbot` label +F-check-cfg |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
messages.ftl |