rustc_attr_parsing/attributes/semantics.rs
1use rustc_hir::attrs::AttributeKind;
2use rustc_span::{Span, Symbol, sym};
3
4use crate::attributes::{NoArgsAttributeParser, OnDuplicate};
5use crate::context::{ALL_TARGETS, AllowedTargets, Stage};
6pub(crate) struct MayDangleParser;
7impl<S: Stage> NoArgsAttributeParser<S> for MayDangleParser {
8 const PATH: &[Symbol] = &[sym::may_dangle];
9 const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
10 const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(ALL_TARGETS); //FIXME Still checked fully in `check_attr.rs`
11 const CREATE: fn(span: Span) -> AttributeKind = AttributeKind::MayDangle;
12}