diff options
| author | Jonathan Brouwer <jonathantbrouwer@gmail.com> | 2025-06-25 09:47:48 +0200 |
|---|---|---|
| committer | Jonathan Brouwer <jonathantbrouwer@gmail.com> | 2025-07-03 07:54:19 +0200 |
| commit | 3d5d72b76105056af5886cbad4661a26f9409b8e (patch) | |
| tree | d6052fe37acd26146cbd4b060ca9b323089180bc /compiler/rustc_attr_parsing/src/attributes/allow_unstable.rs | |
| parent | 25face9808491588e59b6d7844f2185b09eef479 (diff) | |
| download | rust-3d5d72b76105056af5886cbad4661a26f9409b8e.tar.gz rust-3d5d72b76105056af5886cbad4661a26f9409b8e.zip | |
Port `#[target_feature]` to the new attribute parsing infrastructure
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
Diffstat (limited to 'compiler/rustc_attr_parsing/src/attributes/allow_unstable.rs')
| -rw-r--r-- | compiler/rustc_attr_parsing/src/attributes/allow_unstable.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_attr_parsing/src/attributes/allow_unstable.rs b/compiler/rustc_attr_parsing/src/attributes/allow_unstable.rs index 21b01a8d071..1c51c3eee4e 100644 --- a/compiler/rustc_attr_parsing/src/attributes/allow_unstable.rs +++ b/compiler/rustc_attr_parsing/src/attributes/allow_unstable.rs @@ -13,7 +13,8 @@ pub(crate) struct AllowInternalUnstableParser; impl<S: Stage> CombineAttributeParser<S> for AllowInternalUnstableParser { const PATH: &[Symbol] = &[sym::allow_internal_unstable]; type Item = (Symbol, Span); - const CONVERT: ConvertFn<Self::Item> = AttributeKind::AllowInternalUnstable; + const CONVERT: ConvertFn<Self::Item> = + |items, span| AttributeKind::AllowInternalUnstable(items, span); const TEMPLATE: AttributeTemplate = template!(Word, List: "feat1, feat2, ..."); fn extend<'c>( @@ -30,7 +31,8 @@ pub(crate) struct AllowConstFnUnstableParser; impl<S: Stage> CombineAttributeParser<S> for AllowConstFnUnstableParser { const PATH: &[Symbol] = &[sym::rustc_allow_const_fn_unstable]; type Item = Symbol; - const CONVERT: ConvertFn<Self::Item> = AttributeKind::AllowConstFnUnstable; + const CONVERT: ConvertFn<Self::Item> = + |items, first_span| AttributeKind::AllowConstFnUnstable(items, first_span); const TEMPLATE: AttributeTemplate = template!(Word, List: "feat1, feat2, ..."); fn extend<'c>( |
