Skip to content

Commit

Permalink
Unrolled build for rust-lang#124926
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#124926 - Alexendoo:feature-maybe-incorrect, r=est31

Make `#![feature]` suggestion MaybeIncorrect

Fixes rust-lang/rust-clippy#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
  • Loading branch information
rust-timer committed May 9, 2024
2 parents 238c1e7 + 3c52553 commit a5a1c06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2449,7 +2449,7 @@ impl<'tcx> TyCtxt<'tcx> {
span,
msg,
format!("#![feature({feature})]\n"),
Applicability::MachineApplicable,
Applicability::MaybeIncorrect,
);
} else {
diag.help(msg);
Expand Down

0 comments on commit a5a1c06

Please sign in to comment.