diff options
| author | Sasha Pourcelot <sasha.pourcelot@protonmail.com> | 2025-08-03 11:54:07 +0200 |
|---|---|---|
| committer | Sasha Pourcelot <sasha.pourcelot@protonmail.com> | 2025-08-07 15:47:21 +0200 |
| commit | 4f7a6ace9e2f2192af7b5d32f4b1664189e0e143 (patch) | |
| tree | bcea8d88525baf568a9b1e7bea5cc34bf82897e1 /compiler/rustc_attr_parsing/src/attributes/macro_attrs.rs | |
| parent | e1b9081e699065badfc1a9419ec9566e5c8615c4 (diff) | |
| download | rust-4f7a6ace9e2f2192af7b5d32f4b1664189e0e143.tar.gz rust-4f7a6ace9e2f2192af7b5d32f4b1664189e0e143.zip | |
Port `#[allow_internal_unsafe]` to the new attribute system
Diffstat (limited to 'compiler/rustc_attr_parsing/src/attributes/macro_attrs.rs')
| -rw-r--r-- | compiler/rustc_attr_parsing/src/attributes/macro_attrs.rs | 8 |
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); +} |
