about summary refs log tree commit diff
path: root/compiler/rustc_lint/src/lints.rs
diff options
context:
space:
mode:
authorUrgau <urgau@numericable.fr>2025-06-18 19:15:10 +0200
committerUrgau <urgau@numericable.fr>2025-06-18 19:15:10 +0200
commit4df9f2f8412db164e787233d1fc56d2988f255c8 (patch)
treeee4364184b77c5dfb794d89789d78b1bac1da41e /compiler/rustc_lint/src/lints.rs
parent42bb66add31d196bb8d0f0bfb79a00dfd2cad55b (diff)
downloadrust-4df9f2f8412db164e787233d1fc56d2988f255c8.tar.gz
rust-4df9f2f8412db164e787233d1fc56d2988f255c8.zip
Emit the usages suggestions as tool-only suggestions
Diffstat (limited to 'compiler/rustc_lint/src/lints.rs')
-rw-r--r--compiler/rustc_lint/src/lints.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/compiler/rustc_lint/src/lints.rs b/compiler/rustc_lint/src/lints.rs
index d157bf6986c..a20050a10b4 100644
--- a/compiler/rustc_lint/src/lints.rs
+++ b/compiler/rustc_lint/src/lints.rs
@@ -1349,7 +1349,7 @@ pub(crate) struct NonUpperCaseGlobal<'a> {
     #[subdiagnostic]
     pub sub: NonUpperCaseGlobalSub,
     #[subdiagnostic]
-    pub usages: Vec<NonUpperCaseGlobalSub>,
+    pub usages: Vec<NonUpperCaseGlobalSubTool>,
 }
 
 #[derive(Subdiagnostic)]
@@ -1367,6 +1367,19 @@ pub(crate) enum NonUpperCaseGlobalSub {
     },
 }
 
+#[derive(Subdiagnostic)]
+#[suggestion(
+    lint_suggestion,
+    code = "{replace}",
+    applicability = "maybe-incorrect",
+    style = "tool-only"
+)]
+pub(crate) struct NonUpperCaseGlobalSubTool {
+    #[primary_span]
+    pub(crate) span: Span,
+    pub(crate) replace: String,
+}
+
 // noop_method_call.rs
 #[derive(LintDiagnostic)]
 #[diag(lint_noop_method_call)]