Cancel emitting FCW lint if it is an edition fixing lint
This commit is contained in:
parent
aa4457fa5f
commit
43f9d0ae7e
1 changed files with 7 additions and 5 deletions
|
@ -272,11 +272,13 @@ pub fn struct_lint_level<'s, 'd>(
|
||||||
// emit shouldn't be automatically fixed by rustfix.
|
// emit shouldn't be automatically fixed by rustfix.
|
||||||
err.allow_suggestions(false);
|
err.allow_suggestions(false);
|
||||||
|
|
||||||
// If this is a future incompatible lint it'll become a hard error, so
|
// If this is a future incompatible that is not an edition fixing lint
|
||||||
// we have to emit *something*. Also, if this lint occurs in the
|
// it'll become a hard error, so we have to emit *something*. Also,
|
||||||
// expansion of a macro from an external crate, allow individual lints
|
// if this lint occurs in the expansion of a macro from an external crate,
|
||||||
// to opt-out from being reported.
|
// allow individual lints to opt-out from being reported.
|
||||||
if future_incompatible.is_none() && !lint.report_in_external_macro {
|
let not_future_incompatible =
|
||||||
|
future_incompatible.map(|f| f.edition.is_some()).unwrap_or(true);
|
||||||
|
if not_future_incompatible && !lint.report_in_external_macro {
|
||||||
err.cancel();
|
err.cancel();
|
||||||
// Don't continue further, since we don't want to have
|
// Don't continue further, since we don't want to have
|
||||||
// `diag_span_note_once` called for a diagnostic that isn't emitted.
|
// `diag_span_note_once` called for a diagnostic that isn't emitted.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue