rustc_attr_parsing/attributes/no_implicit_prelude.rs
1use rustc_hir::Target;
2use rustc_hir::attrs::AttributeKind;
3use rustc_span::{Span, sym};
4
5use crate::attributes::{NoArgsAttributeParser, OnDuplicate};
6use crate::context::MaybeWarn::Allow;
7use crate::context::{AllowedTargets, Stage};
8pub(crate) struct NoImplicitPreludeParser;
9
10impl<S: Stage> NoArgsAttributeParser<S> for NoImplicitPreludeParser {
11 const PATH: &[rustc_span::Symbol] = &[sym::no_implicit_prelude];
12 const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
13 const ALLOWED_TARGETS: AllowedTargets =
14 AllowedTargets::AllowListWarnRest(&[Allow(Target::Mod), Allow(Target::Crate)]);
15 const CREATE: fn(Span) -> AttributeKind = AttributeKind::NoImplicitPrelude;
16}