about summary refs log tree commit diff
path: root/compiler/rustc_attr_parsing/src/lints.rs
diff options
context:
space:
mode:
authorJana Dönszelmann <jana@donsz.nl>2025-03-04 14:17:06 +0100
committerJana Dönszelmann <jana@donsz.nl>2025-06-17 23:19:31 +0200
commitee976bbbcaf85390a00f03dedacd035e7e274e8e (patch)
treeac9ac3364e06bc17d8aec7742493ebeff2ab3c92 /compiler/rustc_attr_parsing/src/lints.rs
parent566f691374bff0461f2992e381e58539b0e5ae8a (diff)
downloadrust-ee976bbbcaf85390a00f03dedacd035e7e274e8e.tar.gz
rust-ee976bbbcaf85390a00f03dedacd035e7e274e8e.zip
fix bugs in inline/force_inline and diagnostics of all attr parsers
Diffstat (limited to 'compiler/rustc_attr_parsing/src/lints.rs')
-rw-r--r--compiler/rustc_attr_parsing/src/lints.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/compiler/rustc_attr_parsing/src/lints.rs b/compiler/rustc_attr_parsing/src/lints.rs
index d0d112446b4..fee22293b47 100644
--- a/compiler/rustc_attr_parsing/src/lints.rs
+++ b/compiler/rustc_attr_parsing/src/lints.rs
@@ -1,5 +1,5 @@
 use rustc_attr_data_structures::lints::{AttributeLint, AttributeLintKind};
-use rustc_errors::LintEmitter;
+use rustc_errors::{DiagArgValue, LintEmitter};
 use rustc_hir::HirId;
 
 use crate::session_diagnostics;
@@ -15,5 +15,18 @@ pub fn emit_attribute_lint<L: LintEmitter>(lint: &AttributeLint<HirId>, lint_emi
                 *span,
                 session_diagnostics::UnusedDuplicate { this, other, warning },
             ),
+        AttributeLintKind::IllFormedAttributeInput { suggestions } => {
+            lint_emitter.emit_node_span_lint(
+                rustc_session::lint::builtin::ILL_FORMED_ATTRIBUTE_INPUT,
+                *id,
+                *span,
+                session_diagnostics::IllFormedAttributeInput {
+                    num_suggestions: suggestions.len(),
+                    suggestions: DiagArgValue::StrListSepByAnd(
+                        suggestions.into_iter().map(|s| format!("`{s}`").into()).collect(),
+                    ),
+                },
+            );
+        }
     }
 }