about summary refs log tree commit diff
path: root/compiler/rustc_attr_parsing/src/context.rs
diff options
context:
space:
mode:
authorJonathan Brouwer <jonathantbrouwer@gmail.com>2025-07-11 17:02:24 +0200
committerJonathan Brouwer <jonathantbrouwer@gmail.com>2025-07-11 17:02:57 +0200
commit2f05fa6fffb857c08edd0af2dc69f05fa1f02703 (patch)
treef93c4fc162c14431c34c4963611bf1595a25b991 /compiler/rustc_attr_parsing/src/context.rs
parent855e0fe46e68d94e9f6147531b75ac2d488c548e (diff)
downloadrust-2f05fa6fffb857c08edd0af2dc69f05fa1f02703.tar.gz
rust-2f05fa6fffb857c08edd0af2dc69f05fa1f02703.zip
Fix ICE for parsed attributes with longer path not handled by CheckAttrVisitor
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
Diffstat (limited to 'compiler/rustc_attr_parsing/src/context.rs')
-rw-r--r--compiler/rustc_attr_parsing/src/context.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_attr_parsing/src/context.rs b/compiler/rustc_attr_parsing/src/context.rs
index dbe1a5b2ad0..737fe6ba081 100644
--- a/compiler/rustc_attr_parsing/src/context.rs
+++ b/compiler/rustc_attr_parsing/src/context.rs
@@ -718,6 +718,11 @@ impl<'sess, S: Stage> AttributeParser<'sess, S> {
         attributes
     }
 
+    /// Returns whether there is a parser for an attribute with this name
+    pub fn is_parsed_attribute(path: &[Symbol]) -> bool {
+        Late::parsers().0.contains_key(path)
+    }
+
     fn lower_attr_args(&self, args: &ast::AttrArgs, lower_span: impl Fn(Span) -> Span) -> AttrArgs {
         match args {
             ast::AttrArgs::Empty => AttrArgs::Empty,