Skip to content

Commit ced6109

Browse files
Rollup merge of #142980 - shepmaster:mismatched-syntaxes-multi-suggestions, r=ehuss
Reduce mismatched-lifetime-syntaxes suggestions to MaybeIncorrect `cargo fix` does not have a way of distinguishing a suggestion with multiple spans which should all be applied from multiple suggestions where only one should be applied (see #53934). `cargo fix` only works with `MachineApplicable` suggestions, so downgrading the applicability will stop `cargo` from suggesting the user run `cargo fix`. rust-analyzer does work with `MaybeIncorrect`, so interactive fixes are still available. r? `@ehuss`
2 parents c381635 + 46e9d2f commit ced6109

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/rustc_lint/src/lints.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3278,7 +3278,7 @@ impl Subdiagnostic for MismatchedLifetimeSyntaxesSuggestion {
32783278
diag.multipart_suggestion_with_style(
32793279
fluent::lint_mismatched_lifetime_syntaxes_suggestion_implicit,
32803280
suggestions,
3281-
Applicability::MachineApplicable,
3281+
Applicability::MaybeIncorrect,
32823282
style(tool_only),
32833283
);
32843284
}
@@ -3293,7 +3293,7 @@ impl Subdiagnostic for MismatchedLifetimeSyntaxesSuggestion {
32933293
diag.multipart_suggestion_with_style(
32943294
fluent::lint_mismatched_lifetime_syntaxes_suggestion_mixed,
32953295
suggestions,
3296-
Applicability::MachineApplicable,
3296+
Applicability::MaybeIncorrect,
32973297
style(tool_only),
32983298
);
32993299
}
@@ -3308,7 +3308,7 @@ impl Subdiagnostic for MismatchedLifetimeSyntaxesSuggestion {
33083308
diag.multipart_suggestion_with_style(
33093309
msg,
33103310
suggestions,
3311-
Applicability::MachineApplicable,
3311+
Applicability::MaybeIncorrect,
33123312
style(tool_only),
33133313
);
33143314
}

0 commit comments

Comments
 (0)