about summary refs log tree commit diff
path: root/compiler/rustc_lint/src
diff options
context:
space:
mode:
authorJakub Beránek <berykubik@gmail.com>2025-08-13 07:03:49 +0200
committerGitHub <noreply@github.com>2025-08-13 07:03:49 +0200
commitc2bc9265f02f6a36b9b8ed243c7411e0e614922c (patch)
tree882e346b20b626a01e290479029f5fe34fd607a6 /compiler/rustc_lint/src
parent4b1deef096d6bc6f98a2de6afc31d5d25c1905af (diff)
parent2c0409c7e838ef3f9910a6812c085f971e8bbae6 (diff)
downloadrust-c2bc9265f02f6a36b9b8ed243c7411e0e614922c.tar.gz
rust-c2bc9265f02f6a36b9b8ed243c7411e0e614922c.zip
Rollup merge of #145274 - compiler-errors:unused-must-use, r=fmease
Remove unused `#[must_use]`

Self-explanatory

Fixes https://github.com/rust-lang/rust/issues/145257
Diffstat (limited to 'compiler/rustc_lint/src')
-rw-r--r--compiler/rustc_lint/src/early/diagnostics.rs10
-rw-r--r--compiler/rustc_lint/src/lints.rs3
2 files changed, 10 insertions, 3 deletions
diff --git a/compiler/rustc_lint/src/early/diagnostics.rs b/compiler/rustc_lint/src/early/diagnostics.rs
index 1e4bc79ce70..678d3d1f8ed 100644
--- a/compiler/rustc_lint/src/early/diagnostics.rs
+++ b/compiler/rustc_lint/src/early/diagnostics.rs
@@ -205,8 +205,14 @@ pub fn decorate_builtin_lint(
             }
             .decorate_lint(diag);
         }
-        BuiltinLintDiag::UnusedBuiltinAttribute { attr_name, macro_name, invoc_span } => {
-            lints::UnusedBuiltinAttribute { invoc_span, attr_name, macro_name }.decorate_lint(diag);
+        BuiltinLintDiag::UnusedBuiltinAttribute {
+            attr_name,
+            macro_name,
+            invoc_span,
+            attr_span,
+        } => {
+            lints::UnusedBuiltinAttribute { invoc_span, attr_name, macro_name, attr_span }
+                .decorate_lint(diag);
         }
         BuiltinLintDiag::TrailingMacro(is_trailing, name) => {
             lints::TrailingMacro { is_trailing, name }.decorate_lint(diag);
diff --git a/compiler/rustc_lint/src/lints.rs b/compiler/rustc_lint/src/lints.rs
index ba0112c8ac6..a6d59af6900 100644
--- a/compiler/rustc_lint/src/lints.rs
+++ b/compiler/rustc_lint/src/lints.rs
@@ -2938,9 +2938,10 @@ pub(crate) struct RawPrefix {
 pub(crate) struct UnusedBuiltinAttribute {
     #[note]
     pub invoc_span: Span,
-
     pub attr_name: Symbol,
     pub macro_name: String,
+    #[suggestion(code = "", applicability = "machine-applicable", style = "tool-only")]
+    pub attr_span: Span,
 }
 
 #[derive(LintDiagnostic)]