about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJake Goulding <jake.goulding@gmail.com>2025-06-24 13:51:02 -0400
committerJosh Stone <jistone@redhat.com>2025-07-10 13:30:37 -0700
commit736f54bb355da1c11e2eaabba70ada55b88e1b01 (patch)
tree3642bca93f744a6db75962ca294673bfedf47aa5
parentcd3bc5f08239a30169e6b5e2e89f4dc88aa26db2 (diff)
downloadrust-736f54bb355da1c11e2eaabba70ada55b88e1b01.tar.gz
rust-736f54bb355da1c11e2eaabba70ada55b88e1b01.zip
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 issue 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.

(cherry picked from commit 46e9d2f9fc065e33cc54ccfa0e0e3c34376ebeaa)
-rw-r--r--compiler/rustc_lint/src/lints.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_lint/src/lints.rs b/compiler/rustc_lint/src/lints.rs
index abdf8e3853b..c4a6695efe9 100644
--- a/compiler/rustc_lint/src/lints.rs
+++ b/compiler/rustc_lint/src/lints.rs
@@ -3261,7 +3261,7 @@ impl Subdiagnostic for MismatchedLifetimeSyntaxesSuggestion {
                 diag.multipart_suggestion_with_style(
                     fluent::lint_mismatched_lifetime_syntaxes_suggestion_implicit,
                     suggestions,
-                    Applicability::MachineApplicable,
+                    Applicability::MaybeIncorrect,
                     style(tool_only),
                 );
             }
@@ -3276,7 +3276,7 @@ impl Subdiagnostic for MismatchedLifetimeSyntaxesSuggestion {
                 diag.multipart_suggestion_with_style(
                     fluent::lint_mismatched_lifetime_syntaxes_suggestion_mixed,
                     suggestions,
-                    Applicability::MachineApplicable,
+                    Applicability::MaybeIncorrect,
                     style(tool_only),
                 );
             }
@@ -3291,7 +3291,7 @@ impl Subdiagnostic for MismatchedLifetimeSyntaxesSuggestion {
                 diag.multipart_suggestion_with_style(
                     msg,
                     suggestions,
-                    Applicability::MachineApplicable,
+                    Applicability::MaybeIncorrect,
                     style(tool_only),
                 );
             }