Fix invalid check-cfg Cargo feature diagnostic help

This commit is contained in:
Urgau 2023-12-30 01:06:03 +01:00
parent 621e241748
commit a25e0236df
2 changed files with 1 additions and 4 deletions

View File

@ -804,8 +804,6 @@ fn lookup_with_diagnostics(
db.span_suggestion(value_span, "there is a expected value with a similar name", format!("\"{best_match}\""), Applicability::MaybeIncorrect);
}
} else if name == sym::feature && is_from_cargo {
db.help(format!("consider defining `{name}` as feature in `Cargo.toml`"));
} else if let &[first_possibility] = &possibilities[..] {
db.span_suggestion(name_span.shrink_to_hi(), "specify a config value", format!(" = \"{first_possibility}\""), Applicability::MaybeIncorrect);
}

View File

@ -13,10 +13,9 @@ warning: unexpected `cfg` condition value: (none)
--> $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`
= note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration
warning: unexpected `cfg` condition name: `tokio_unstable`