about summary refs log tree commit diff
path: root/compiler/rustc_attr_parsing/src/attributes/macro_attrs.rs
diff options
context:
space:
mode:
authorSasha Pourcelot <sasha.pourcelot@protonmail.com>2025-08-03 11:54:07 +0200
committerSasha Pourcelot <sasha.pourcelot@protonmail.com>2025-08-11 15:01:52 +0200
commit6603fe1caa9aefea78aea19c587828cdcffc883d (patch)
tree598fa31565a96e679286e1bd1fe2830428bd7ab5 /compiler/rustc_attr_parsing/src/attributes/macro_attrs.rs
parent577166503aee7290e09374da21f4045c455acfd5 (diff)
downloadrust-6603fe1caa9aefea78aea19c587828cdcffc883d.tar.gz
rust-6603fe1caa9aefea78aea19c587828cdcffc883d.zip
Port `#[allow_internal_unsafe]` to the new attribute system (attempt 2)
Diffstat (limited to 'compiler/rustc_attr_parsing/src/attributes/macro_attrs.rs')
-rw-r--r--compiler/rustc_attr_parsing/src/attributes/macro_attrs.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_attr_parsing/src/attributes/macro_attrs.rs b/compiler/rustc_attr_parsing/src/attributes/macro_attrs.rs
index 886f7a889d3..0779248e1a9 100644
--- a/compiler/rustc_attr_parsing/src/attributes/macro_attrs.rs
+++ b/compiler/rustc_attr_parsing/src/attributes/macro_attrs.rs
@@ -113,3 +113,11 @@ impl<S: Stage> AttributeParser<S> for MacroUseParser {
         Some(AttributeKind::MacroUse { span: self.first_span?, arguments: self.state })
     }
 }
+
+pub(crate) struct AllowInternalUnsafeParser;
+
+impl<S: Stage> NoArgsAttributeParser<S> for AllowInternalUnsafeParser {
+    const PATH: &[Symbol] = &[sym::allow_internal_unsafe];
+    const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Ignore;
+    const CREATE: fn(Span) -> AttributeKind = |span| AttributeKind::AllowInternalUnsafe(span);
+}