rustc_attr_parsing/attributes/pin_v2.rs
1use rustc_hir::Target;
2use rustc_hir::attrs::AttributeKind;
3use rustc_span::{Span, Symbol, sym};
4
5use crate::attributes::NoArgsAttributeParser;
6use crate::context::Stage;
7use crate::target_checking::AllowedTargets;
8use crate::target_checking::Policy::Allow;
9
10pub(crate) struct PinV2Parser;
11
12impl<S: Stage> NoArgsAttributeParser<S> for PinV2Parser {
13 const PATH: &[Symbol] = &[sym::pin_v2];
14 const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[
15 Allow(Target::Enum),
16 Allow(Target::Struct),
17 Allow(Target::Union),
18 ]);
19 const CREATE: fn(Span) -> AttributeKind = AttributeKind::PinV2;
20}