Fix invalid check-cfg Cargo feature diagnostic help
This commit is contained in:
parent
621e241748
commit
a25e0236df
@ -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);
|
||||
}
|
||||
|
@ -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`
|
||||
|
Loading…
Reference in New Issue
Block a user