about summary refs log tree commit diff
path: root/compiler/rustc_attr_parsing/src/validate_attr.rs
diff options
context:
space:
mode:
authorJonathan Brouwer <jonathantbrouwer@gmail.com>2025-07-31 15:38:08 +0200
committerJonathan Brouwer <jonathantbrouwer@gmail.com>2025-08-22 08:58:45 +0200
commit17e34f6b2418975a360755a1e1a3b8793864da9b (patch)
tree63f0e2d2f543cee219d18f565b0ba445b550899b /compiler/rustc_attr_parsing/src/validate_attr.rs
parent549314bdb7b7a3ac1313feea9283366f5115fca7 (diff)
downloadrust-17e34f6b2418975a360755a1e1a3b8793864da9b.tar.gz
rust-17e34f6b2418975a360755a1e1a3b8793864da9b.zip
Use the new attribute parser throughout the codebase
Diffstat (limited to 'compiler/rustc_attr_parsing/src/validate_attr.rs')
-rw-r--r--compiler/rustc_attr_parsing/src/validate_attr.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_attr_parsing/src/validate_attr.rs b/compiler/rustc_attr_parsing/src/validate_attr.rs
index da3a1cbe016..7a7624893bd 100644
--- a/compiler/rustc_attr_parsing/src/validate_attr.rs
+++ b/compiler/rustc_attr_parsing/src/validate_attr.rs
@@ -33,7 +33,10 @@ pub fn check_attr(psess: &ParseSess, attr: &Attribute, id: NodeId) {
     // Check input tokens for built-in and key-value attributes.
     match builtin_attr_info {
         // `rustc_dummy` doesn't have any restrictions specific to built-in attributes.
-        Some(BuiltinAttribute { name, template, .. }) if *name != sym::rustc_dummy => {
+        Some(BuiltinAttribute { name, template, .. }) => {
+            if AttributeParser::<Late>::is_parsed_attribute(slice::from_ref(&name)) {
+                return;
+            }
             match parse_meta(psess, attr) {
                 // Don't check safety again, we just did that
                 Ok(meta) => {
@@ -259,9 +262,6 @@ pub fn check_builtin_meta_item(
 ) {
     if !is_attr_template_compatible(&template, &meta.kind) {
         // attrs with new parsers are locally validated so excluded here
-        if AttributeParser::<Late>::is_parsed_attribute(slice::from_ref(&name)) {
-            return;
-        }
         emit_malformed_attribute(psess, style, meta.span, name, template);
     }