summary refs log tree commit diff
path: root/compiler/rustc_parse
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_parse
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_parse')
-rw-r--r--compiler/rustc_parse/src/validate_attr.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/compiler/rustc_parse/src/validate_attr.rs b/compiler/rustc_parse/src/validate_attr.rs
index 555ab3cdb2b..1c12e8c189d 100644
--- a/compiler/rustc_parse/src/validate_attr.rs
+++ b/compiler/rustc_parse/src/validate_attr.rs
@@ -282,11 +282,15 @@ fn emit_malformed_attribute(
     name: Symbol,
     template: AttributeTemplate,
 ) {
+    // attrs with new parsers are locally validated so excluded here
+    if matches!(name, sym::inline | sym::rustc_force_inline) {
+        return;
+    }
+
     // Some of previously accepted forms were used in practice,
     // report them as warnings for now.
-    let should_warn = |name| {
-        matches!(name, sym::doc | sym::ignore | sym::inline | sym::link | sym::test | sym::bench)
-    };
+    let should_warn =
+        |name| matches!(name, sym::doc | sym::ignore | sym::link | sym::test | sym::bench);
 
     let error_msg = format!("malformed `{name}` attribute input");
     let mut suggestions = vec![];