Rollup merge of #124926 - Alexendoo:feature-maybe-incorrect, r=est31

Make `#![feature]` suggestion MaybeIncorrect

Fixes https://github.com/rust-lang/rust-clippy/issues/12784

The `unstable_name_collisions` lint uses `disabled_nightly_features` to mention the feature name, but accepting the suggestion would result in an ambiguity error

There are other calls where accepting the feature gate would fix code when ran with `cargo fix --broken-code`, though it's not always desirable to add a feature gate even if the user is currently on nightly so MaybeIncorrect seems appropriate
This commit is contained in:
Matthias Krüger 2024-05-09 19:09:31 +02:00 committed by GitHub
commit 779fe95298
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2449,7 +2449,7 @@ pub fn disabled_nightly_features<E: rustc_errors::EmissionGuarantee>(
span, span,
msg, msg,
format!("#![feature({feature})]\n"), format!("#![feature({feature})]\n"),
Applicability::MachineApplicable, Applicability::MaybeIncorrect,
); );
} else { } else {
diag.help(msg); diag.help(msg);