diff --git a/compiler/rustc_attr_parsing/src/attributes/allow_unstable.rs b/compiler/rustc_attr_parsing/src/attributes/allow_unstable.rs index 4f1a8cd8b403c..c2511ac75d5d2 100644 --- a/compiler/rustc_attr_parsing/src/attributes/allow_unstable.rs +++ b/compiler/rustc_attr_parsing/src/attributes/allow_unstable.rs @@ -52,8 +52,8 @@ impl CombineAttributeParser for UnstableFeatureBoundParser { } } -pub(crate) struct AllowConstFnUnstableParser; -impl CombineAttributeParser for AllowConstFnUnstableParser { +pub(crate) struct RustcAllowConstFnUnstableParser; +impl CombineAttributeParser for RustcAllowConstFnUnstableParser { const PATH: &[Symbol] = &[sym::rustc_allow_const_fn_unstable]; type Item = Symbol; const CONVERT: ConvertFn = diff --git a/compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs b/compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs index 485307622291e..4909e0d35173c 100644 --- a/compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs +++ b/compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs @@ -153,9 +153,9 @@ impl SingleAttributeParser for ExportNameParser { } } -pub(crate) struct ObjcClassParser; +pub(crate) struct RustcObjcClassParser; -impl SingleAttributeParser for ObjcClassParser { +impl SingleAttributeParser for RustcObjcClassParser { const PATH: &[rustc_span::Symbol] = &[sym::rustc_objc_class]; const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepInnermost; const ON_DUPLICATE: OnDuplicate = OnDuplicate::Error; @@ -185,9 +185,9 @@ impl SingleAttributeParser for ObjcClassParser { } } -pub(crate) struct ObjcSelectorParser; +pub(crate) struct RustcObjcSelectorParser; -impl SingleAttributeParser for ObjcSelectorParser { +impl SingleAttributeParser for RustcObjcSelectorParser { const PATH: &[rustc_span::Symbol] = &[sym::rustc_objc_selector]; const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepInnermost; const ON_DUPLICATE: OnDuplicate = OnDuplicate::Error; @@ -709,13 +709,13 @@ impl NoArgsAttributeParser for RustcPassIndirectlyInNonRusticAbisPa const CREATE: fn(Span) -> AttributeKind = AttributeKind::RustcPassIndirectlyInNonRusticAbis; } -pub(crate) struct EiiForeignItemParser; +pub(crate) struct RustcEiiForeignItemParser; -impl NoArgsAttributeParser for EiiForeignItemParser { +impl NoArgsAttributeParser for RustcEiiForeignItemParser { const PATH: &[Symbol] = &[sym::rustc_eii_foreign_item]; const ON_DUPLICATE: OnDuplicate = OnDuplicate::Error; const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::ForeignFn)]); - const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::EiiForeignItem; + const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcEiiForeignItem; } pub(crate) struct PatchableFunctionEntryParser; diff --git a/compiler/rustc_attr_parsing/src/attributes/deprecation.rs b/compiler/rustc_attr_parsing/src/attributes/deprecation.rs index c055c2936e953..a2c7e459e0df8 100644 --- a/compiler/rustc_attr_parsing/src/attributes/deprecation.rs +++ b/compiler/rustc_attr_parsing/src/attributes/deprecation.rs @@ -7,8 +7,6 @@ use crate::session_diagnostics::{ DeprecatedItemSuggestion, InvalidSince, MissingNote, MissingSince, }; -pub(crate) struct DeprecationParser; - fn get( cx: &AcceptContext<'_, '_, S>, name: Symbol, @@ -33,7 +31,8 @@ fn get( } } -impl SingleAttributeParser for DeprecationParser { +pub(crate) struct DeprecatedParser; +impl SingleAttributeParser for DeprecatedParser { const PATH: &[Symbol] = &[sym::deprecated]; const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepInnermost; const ON_DUPLICATE: OnDuplicate = OnDuplicate::Error; @@ -164,7 +163,7 @@ impl SingleAttributeParser for DeprecationParser { return None; } - Some(AttributeKind::Deprecation { + Some(AttributeKind::Deprecated { deprecation: Deprecation { since, note, suggestion }, span: cx.attr_span, }) diff --git a/compiler/rustc_attr_parsing/src/attributes/dummy.rs b/compiler/rustc_attr_parsing/src/attributes/dummy.rs index 9f97af48afa05..71d10b23a37f6 100644 --- a/compiler/rustc_attr_parsing/src/attributes/dummy.rs +++ b/compiler/rustc_attr_parsing/src/attributes/dummy.rs @@ -7,8 +7,8 @@ use crate::context::{AcceptContext, Stage}; use crate::parser::ArgParser; use crate::target_checking::{ALL_TARGETS, AllowedTargets}; -pub(crate) struct DummyParser; -impl SingleAttributeParser for DummyParser { +pub(crate) struct RustcDummyParser; +impl SingleAttributeParser for RustcDummyParser { const PATH: &[Symbol] = &[sym::rustc_dummy]; const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepInnermost; const ON_DUPLICATE: OnDuplicate = OnDuplicate::Ignore; diff --git a/compiler/rustc_attr_parsing/src/attributes/link_attrs.rs b/compiler/rustc_attr_parsing/src/attributes/link_attrs.rs index 21c05611ce292..c4a483157a19d 100644 --- a/compiler/rustc_attr_parsing/src/attributes/link_attrs.rs +++ b/compiler/rustc_attr_parsing/src/attributes/link_attrs.rs @@ -524,8 +524,8 @@ impl NoArgsAttributeParser for FfiPureParser { const CREATE: fn(Span) -> AttributeKind = AttributeKind::FfiPure; } -pub(crate) struct StdInternalSymbolParser; -impl NoArgsAttributeParser for StdInternalSymbolParser { +pub(crate) struct RustcStdInternalSymbolParser; +impl NoArgsAttributeParser for RustcStdInternalSymbolParser { const PATH: &[Symbol] = &[sym::rustc_std_internal_symbol]; const ON_DUPLICATE: OnDuplicate = OnDuplicate::Error; const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[ diff --git a/compiler/rustc_attr_parsing/src/attributes/lint_helpers.rs b/compiler/rustc_attr_parsing/src/attributes/lint_helpers.rs index 60e83a6083ede..76bddacd20bf4 100644 --- a/compiler/rustc_attr_parsing/src/attributes/lint_helpers.rs +++ b/compiler/rustc_attr_parsing/src/attributes/lint_helpers.rs @@ -1,7 +1,7 @@ use super::prelude::*; -pub(crate) struct AsPtrParser; -impl NoArgsAttributeParser for AsPtrParser { +pub(crate) struct RustcAsPtrParser; +impl NoArgsAttributeParser for RustcAsPtrParser { const PATH: &[Symbol] = &[sym::rustc_as_ptr]; const ON_DUPLICATE: OnDuplicate = OnDuplicate::Error; const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[ @@ -14,8 +14,8 @@ impl NoArgsAttributeParser for AsPtrParser { const CREATE: fn(Span) -> AttributeKind = AttributeKind::RustcAsPtr; } -pub(crate) struct PubTransparentParser; -impl NoArgsAttributeParser for PubTransparentParser { +pub(crate) struct RustcPubTransparentParser; +impl NoArgsAttributeParser for RustcPubTransparentParser { const PATH: &[Symbol] = &[sym::rustc_pub_transparent]; const ON_DUPLICATE: OnDuplicate = OnDuplicate::Error; const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[ @@ -26,8 +26,8 @@ impl NoArgsAttributeParser for PubTransparentParser { const CREATE: fn(Span) -> AttributeKind = AttributeKind::RustcPubTransparent; } -pub(crate) struct PassByValueParser; -impl NoArgsAttributeParser for PassByValueParser { +pub(crate) struct RustcPassByValueParser; +impl NoArgsAttributeParser for RustcPassByValueParser { const PATH: &[Symbol] = &[sym::rustc_pass_by_value]; const ON_DUPLICATE: OnDuplicate = OnDuplicate::Error; const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[ @@ -38,8 +38,8 @@ impl NoArgsAttributeParser for PassByValueParser { const CREATE: fn(Span) -> AttributeKind = AttributeKind::RustcPassByValue; } -pub(crate) struct RustcShouldNotBeCalledOnConstItems; -impl NoArgsAttributeParser for RustcShouldNotBeCalledOnConstItems { +pub(crate) struct RustcShouldNotBeCalledOnConstItemsParser; +impl NoArgsAttributeParser for RustcShouldNotBeCalledOnConstItemsParser { const PATH: &[Symbol] = &[sym::rustc_should_not_be_called_on_const_items]; const ON_DUPLICATE: OnDuplicate = OnDuplicate::Error; const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[ diff --git a/compiler/rustc_attr_parsing/src/attributes/repr.rs b/compiler/rustc_attr_parsing/src/attributes/repr.rs index fb0b8df652848..f0fc2a5b5e939 100644 --- a/compiler/rustc_attr_parsing/src/attributes/repr.rs +++ b/compiler/rustc_attr_parsing/src/attributes/repr.rs @@ -269,9 +269,9 @@ fn parse_alignment(node: &LitKind) -> Result { /// Parse #[align(N)]. #[derive(Default)] -pub(crate) struct AlignParser(Option<(Align, Span)>); +pub(crate) struct RustcAlignParser(Option<(Align, Span)>); -impl AlignParser { +impl RustcAlignParser { const PATH: &[Symbol] = &[sym::rustc_align]; const TEMPLATE: AttributeTemplate = template!(List: &[""]); @@ -308,7 +308,7 @@ impl AlignParser { } } -impl AttributeParser for AlignParser { +impl AttributeParser for RustcAlignParser { const ATTRIBUTES: AcceptMapping = &[(Self::PATH, Self::TEMPLATE, Self::parse)]; const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[ Allow(Target::Fn), @@ -321,29 +321,29 @@ impl AttributeParser for AlignParser { fn finalize(self, _cx: &FinalizeContext<'_, '_, S>) -> Option { let (align, span) = self.0?; - Some(AttributeKind::Align { align, span }) + Some(AttributeKind::RustcAlign { align, span }) } } #[derive(Default)] -pub(crate) struct AlignStaticParser(AlignParser); +pub(crate) struct RustcAlignStaticParser(RustcAlignParser); -impl AlignStaticParser { +impl RustcAlignStaticParser { const PATH: &[Symbol] = &[sym::rustc_align_static]; - const TEMPLATE: AttributeTemplate = AlignParser::TEMPLATE; + const TEMPLATE: AttributeTemplate = RustcAlignParser::TEMPLATE; fn parse(&mut self, cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser) { self.0.parse(cx, args) } } -impl AttributeParser for AlignStaticParser { +impl AttributeParser for RustcAlignStaticParser { const ATTRIBUTES: AcceptMapping = &[(Self::PATH, Self::TEMPLATE, Self::parse)]; const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Static), Allow(Target::ForeignStatic)]); fn finalize(self, _cx: &FinalizeContext<'_, '_, S>) -> Option { let (align, span) = self.0.0?; - Some(AttributeKind::Align { align, span }) + Some(AttributeKind::RustcAlign { align, span }) } } diff --git a/compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs b/compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs index c18e292027517..85e7112adbc21 100644 --- a/compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs +++ b/compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs @@ -71,9 +71,9 @@ impl SingleAttributeParser for RustcMustImplementOneOfParser { } } -pub(crate) struct RustcNeverReturnsNullPointerParser; +pub(crate) struct RustcNeverReturnsNullPtrParser; -impl NoArgsAttributeParser for RustcNeverReturnsNullPointerParser { +impl NoArgsAttributeParser for RustcNeverReturnsNullPtrParser { const PATH: &[Symbol] = &[sym::rustc_never_returns_null_ptr]; const ON_DUPLICATE: OnDuplicate = OnDuplicate::Error; const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[ @@ -83,7 +83,7 @@ impl NoArgsAttributeParser for RustcNeverReturnsNullPointerParser { Allow(Target::Method(MethodKind::Trait { body: true })), Allow(Target::Method(MethodKind::TraitImpl)), ]); - const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcNeverReturnsNullPointer; + const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcNeverReturnsNullPtr; } pub(crate) struct RustcNoImplicitAutorefsParser; @@ -1215,9 +1215,10 @@ impl NoArgsAttributeParser for RustcNonnullOptimizationGuaranteedPa const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcNonnullOptimizationGuaranteed; } -pub(crate) struct RustcSymbolName; +pub(crate) struct RustcSymbolNameParser; -impl SingleAttributeParser for RustcSymbolName { +impl SingleAttributeParser for RustcSymbolNameParser { + const PATH: &[Symbol] = &[sym::rustc_symbol_name]; const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[ Allow(Target::Fn), Allow(Target::Method(MethodKind::TraitImpl)), @@ -1228,7 +1229,6 @@ impl SingleAttributeParser for RustcSymbolName { Allow(Target::Impl { of_trait: false }), ]); const ON_DUPLICATE: OnDuplicate = OnDuplicate::Error; - const PATH: &[Symbol] = &[sym::rustc_symbol_name]; const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepInnermost; const TEMPLATE: AttributeTemplate = template!(Word); fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser) -> Option { @@ -1240,9 +1240,10 @@ impl SingleAttributeParser for RustcSymbolName { } } -pub(crate) struct RustcDefPath; +pub(crate) struct RustcDefPathParser; -impl SingleAttributeParser for RustcDefPath { +impl SingleAttributeParser for RustcDefPathParser { + const PATH: &[Symbol] = &[sym::rustc_def_path]; const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[ Allow(Target::Fn), Allow(Target::Method(MethodKind::TraitImpl)), @@ -1253,7 +1254,6 @@ impl SingleAttributeParser for RustcDefPath { Allow(Target::Impl { of_trait: false }), ]); const ON_DUPLICATE: OnDuplicate = OnDuplicate::Error; - const PATH: &[Symbol] = &[sym::rustc_def_path]; const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepInnermost; const TEMPLATE: AttributeTemplate = template!(Word); fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser) -> Option { diff --git a/compiler/rustc_attr_parsing/src/attributes/stability.rs b/compiler/rustc_attr_parsing/src/attributes/stability.rs index a2be2d42b3e1a..941885d232c27 100644 --- a/compiler/rustc_attr_parsing/src/attributes/stability.rs +++ b/compiler/rustc_attr_parsing/src/attributes/stability.rs @@ -177,15 +177,15 @@ impl AttributeParser for BodyStabilityParser { } } -pub(crate) struct ConstStabilityIndirectParser; -impl NoArgsAttributeParser for ConstStabilityIndirectParser { +pub(crate) struct RustcConstStableIndirectParser; +impl NoArgsAttributeParser for RustcConstStableIndirectParser { const PATH: &[Symbol] = &[sym::rustc_const_stable_indirect]; const ON_DUPLICATE: OnDuplicate = OnDuplicate::Ignore; const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[ Allow(Target::Fn), Allow(Target::Method(MethodKind::Inherent)), ]); - const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcConstStabilityIndirect; + const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcConstStableIndirect; } #[derive(Default)] diff --git a/compiler/rustc_attr_parsing/src/attributes/traits.rs b/compiler/rustc_attr_parsing/src/attributes/traits.rs index ceaa43948d676..c09e151fc70c1 100644 --- a/compiler/rustc_attr_parsing/src/attributes/traits.rs +++ b/compiler/rustc_attr_parsing/src/attributes/traits.rs @@ -9,8 +9,8 @@ use crate::parser::ArgParser; use crate::target_checking::Policy::{Allow, Warn}; use crate::target_checking::{ALL_TARGETS, AllowedTargets}; -pub(crate) struct SkipDuringMethodDispatchParser; -impl SingleAttributeParser for SkipDuringMethodDispatchParser { +pub(crate) struct RustcSkipDuringMethodDispatchParser; +impl SingleAttributeParser for RustcSkipDuringMethodDispatchParser { const PATH: &[Symbol] = &[sym::rustc_skip_during_method_dispatch]; const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepInnermost; const ON_DUPLICATE: OnDuplicate = OnDuplicate::Error; @@ -58,8 +58,8 @@ impl SingleAttributeParser for SkipDuringMethodDispatchParser { } } -pub(crate) struct ParenSugarParser; -impl NoArgsAttributeParser for ParenSugarParser { +pub(crate) struct RustcParenSugarParser; +impl NoArgsAttributeParser for RustcParenSugarParser { const PATH: &[Symbol] = &[sym::rustc_paren_sugar]; const ON_DUPLICATE: OnDuplicate = OnDuplicate::Error; const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Trait)]); @@ -81,16 +81,16 @@ impl NoArgsAttributeParser for MarkerParser { const CREATE: fn(Span) -> AttributeKind = AttributeKind::Marker; } -pub(crate) struct DenyExplicitImplParser; -impl NoArgsAttributeParser for DenyExplicitImplParser { +pub(crate) struct RustcDenyExplicitImplParser; +impl NoArgsAttributeParser for RustcDenyExplicitImplParser { const PATH: &[Symbol] = &[sym::rustc_deny_explicit_impl]; const ON_DUPLICATE: OnDuplicate = OnDuplicate::Error; const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Trait)]); const CREATE: fn(Span) -> AttributeKind = AttributeKind::RustcDenyExplicitImpl; } -pub(crate) struct DynIncompatibleTraitParser; -impl NoArgsAttributeParser for DynIncompatibleTraitParser { +pub(crate) struct RustcDynIncompatibleTraitParser; +impl NoArgsAttributeParser for RustcDynIncompatibleTraitParser { const PATH: &[Symbol] = &[sym::rustc_dyn_incompatible_trait]; const ON_DUPLICATE: OnDuplicate = OnDuplicate::Error; const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Trait)]); @@ -99,16 +99,16 @@ impl NoArgsAttributeParser for DynIncompatibleTraitParser { // Specialization -pub(crate) struct SpecializationTraitParser; -impl NoArgsAttributeParser for SpecializationTraitParser { +pub(crate) struct RustcSpecializationTraitParser; +impl NoArgsAttributeParser for RustcSpecializationTraitParser { const PATH: &[Symbol] = &[sym::rustc_specialization_trait]; const ON_DUPLICATE: OnDuplicate = OnDuplicate::Error; const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Trait)]); const CREATE: fn(Span) -> AttributeKind = AttributeKind::RustcSpecializationTrait; } -pub(crate) struct UnsafeSpecializationMarkerParser; -impl NoArgsAttributeParser for UnsafeSpecializationMarkerParser { +pub(crate) struct RustcUnsafeSpecializationMarkerParser; +impl NoArgsAttributeParser for RustcUnsafeSpecializationMarkerParser { const PATH: &[Symbol] = &[sym::rustc_unsafe_specialization_marker]; const ON_DUPLICATE: OnDuplicate = OnDuplicate::Error; const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Trait)]); @@ -117,16 +117,16 @@ impl NoArgsAttributeParser for UnsafeSpecializationMarkerParser { // Coherence -pub(crate) struct CoinductiveParser; -impl NoArgsAttributeParser for CoinductiveParser { +pub(crate) struct RustcCoinductiveParser; +impl NoArgsAttributeParser for RustcCoinductiveParser { const PATH: &[Symbol] = &[sym::rustc_coinductive]; const ON_DUPLICATE: OnDuplicate = OnDuplicate::Error; const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Trait)]); const CREATE: fn(Span) -> AttributeKind = AttributeKind::RustcCoinductive; } -pub(crate) struct AllowIncoherentImplParser; -impl NoArgsAttributeParser for AllowIncoherentImplParser { +pub(crate) struct RustcAllowIncoherentImplParser; +impl NoArgsAttributeParser for RustcAllowIncoherentImplParser { const PATH: &[Symbol] = &[sym::rustc_allow_incoherent_impl]; const ON_DUPLICATE: OnDuplicate = OnDuplicate::Error; const ALLOWED_TARGETS: AllowedTargets = diff --git a/compiler/rustc_attr_parsing/src/attributes/transparency.rs b/compiler/rustc_attr_parsing/src/attributes/transparency.rs index 7fa4487b7c691..58b4a0b2fb1ad 100644 --- a/compiler/rustc_attr_parsing/src/attributes/transparency.rs +++ b/compiler/rustc_attr_parsing/src/attributes/transparency.rs @@ -2,9 +2,9 @@ use rustc_span::hygiene::Transparency; use super::prelude::*; -pub(crate) struct TransparencyParser; +pub(crate) struct RustcMacroTransparencyParser; -impl SingleAttributeParser for TransparencyParser { +impl SingleAttributeParser for RustcMacroTransparencyParser { const PATH: &[Symbol] = &[sym::rustc_macro_transparency]; const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepInnermost; const ON_DUPLICATE: OnDuplicate = OnDuplicate::Custom(|cx, used, unused| { diff --git a/compiler/rustc_attr_parsing/src/context.rs b/compiler/rustc_attr_parsing/src/context.rs index 2cb5e6d8f6149..b82607e7c450d 100644 --- a/compiler/rustc_attr_parsing/src/context.rs +++ b/compiler/rustc_attr_parsing/src/context.rs @@ -141,8 +141,6 @@ macro_rules! attribute_parsers { attribute_parsers!( pub(crate) static ATTRIBUTE_PARSERS = [ // tidy-alphabetical-start - AlignParser, - AlignStaticParser, BodyStabilityParser, ConfusablesParser, ConstStabilityParser, @@ -151,13 +149,14 @@ attribute_parsers!( NakedParser, OnConstParser, OnUnimplementedParser, + RustcAlignParser, + RustcAlignStaticParser, RustcCguTestAttributeParser, StabilityParser, UsedParser, // tidy-alphabetical-end // tidy-alphabetical-start - Combine, Combine, Combine, Combine, @@ -166,6 +165,7 @@ attribute_parsers!( Combine, Combine, Combine, + Combine, Combine, Combine, Combine, @@ -180,9 +180,8 @@ attribute_parsers!( Single, Single, Single, - Single, + Single, Single, - Single, Single, Single, Single, @@ -196,8 +195,6 @@ attribute_parsers!( Single, Single, Single, - Single, - Single, Single, Single, Single, @@ -208,44 +205,40 @@ attribute_parsers!( Single, Single, Single, - Single, + Single, Single, Single, Single, + Single, Single, Single, Single, Single, Single, Single, + Single, Single, Single, + Single, + Single, Single, Single, Single, - Single, + Single, + Single, Single, Single, Single, - Single, Single, - Single, Single, Single, - Single>, Single>, - Single>, Single>, - Single>, Single>, Single>, Single>, - Single>, Single>, Single>, - Single>, - Single>, - Single>, Single>, Single>, Single>, @@ -266,29 +259,33 @@ attribute_parsers!( Single>, Single>, Single>, - Single>, - Single>, Single>, Single>, Single>, Single>, Single>, Single>, - Single>, Single>, Single>, + Single>, + Single>, Single>, Single>, + Single>, + Single>, Single>, Single>, Single>, + Single>, Single>, Single>, Single>, Single>, Single>, Single>, + Single>, Single>, + Single>, Single>, Single>, Single>, @@ -300,7 +297,7 @@ attribute_parsers!( Single>, Single>, Single>, - Single>, + Single>, Single>, Single>, Single>, @@ -310,21 +307,24 @@ attribute_parsers!( Single>, Single>, Single>, + Single>, + Single>, Single>, Single>, Single>, + Single>, Single>, Single>, - Single>, + Single>, + Single>, + Single>, Single>, Single>, + Single>, Single>, Single>, - Single>, - Single>, Single>, Single>, - Single>, // tidy-alphabetical-end ]; ); diff --git a/compiler/rustc_codegen_ssa/src/codegen_attrs.rs b/compiler/rustc_codegen_ssa/src/codegen_attrs.rs index 6b0d46f5dc5d1..43f039cc5ebfd 100644 --- a/compiler/rustc_codegen_ssa/src/codegen_attrs.rs +++ b/compiler/rustc_codegen_ssa/src/codegen_attrs.rs @@ -80,7 +80,7 @@ fn process_builtin_attrs( interesting_spans.inline = Some(*span); } AttributeKind::Naked(_) => codegen_fn_attrs.flags |= CodegenFnAttrFlags::NAKED, - AttributeKind::Align { align, .. } => codegen_fn_attrs.alignment = Some(*align), + AttributeKind::RustcAlign { align, .. } => codegen_fn_attrs.alignment = Some(*align), AttributeKind::LinkName { name, .. } => { // FIXME Remove check for foreign functions once #[link_name] on non-foreign // functions is a hard error @@ -223,7 +223,7 @@ fn process_builtin_attrs( AttributeKind::RustcObjcSelector { methname, .. } => { codegen_fn_attrs.objc_selector = Some(*methname); } - AttributeKind::EiiForeignItem => { + AttributeKind::RustcEiiForeignItem => { codegen_fn_attrs.flags |= CodegenFnAttrFlags::EXTERNALLY_IMPLEMENTABLE_ITEM; } AttributeKind::EiiImpls(impls) => { diff --git a/compiler/rustc_expand/src/base.rs b/compiler/rustc_expand/src/base.rs index ae3022b83e564..225906dfba2de 100644 --- a/compiler/rustc_expand/src/base.rs +++ b/compiler/rustc_expand/src/base.rs @@ -974,7 +974,7 @@ impl SyntaxExtension { stability, deprecation: find_attr!( attrs, - Deprecation { deprecation, .. } => *deprecation + Deprecated { deprecation, .. } => *deprecation ), helper_attrs, edition, diff --git a/compiler/rustc_hir/src/attrs/data_structures.rs b/compiler/rustc_hir/src/attrs/data_structures.rs index f9cb557d020dd..68f5bb94c3fe8 100644 --- a/compiler/rustc_hir/src/attrs/data_structures.rs +++ b/compiler/rustc_hir/src/attrs/data_structures.rs @@ -846,13 +846,6 @@ pub struct RustcCleanQueries { #[derive(Clone, Debug, HashStable_Generic, Encodable, Decodable, PrintAttribute)] pub enum AttributeKind { // tidy-alphabetical-start - /// Represents `#[align(N)]`. - // FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity - Align { - align: Align, - span: Span, - }, - /// Represents `#[allow_internal_unsafe]`. AllowInternalUnsafe(Span), @@ -911,7 +904,7 @@ pub enum AttributeKind { DefaultLibAllocator, /// Represents [`#[deprecated]`](https://doc.rust-lang.org/stable/reference/attributes/diagnostics.html#the-deprecated-attribute). - Deprecation { + Deprecated { deprecation: Deprecation, span: Span, }, @@ -938,9 +931,6 @@ pub enum AttributeKind { /// Implementation detail of `#[eii]` EiiDeclaration(EiiDecl), - /// Implementation detail of `#[eii]` - EiiForeignItem, - /// Implementation detail of `#[eii]` EiiImpls(ThinVec), @@ -1169,6 +1159,13 @@ pub enum AttributeKind { kind: RustcAbiAttrKind, }, + /// Represents `#[align(N)]`. + // FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity + RustcAlign { + align: Align, + span: Span, + }, + /// Represents `#[rustc_allocator]` RustcAllocator, @@ -1230,7 +1227,7 @@ pub enum AttributeKind { }, /// Represents `#[rustc_const_stable_indirect]`. - RustcConstStabilityIndirect, + RustcConstStableIndirect, /// Represents `#[rustc_conversion_suggestion]` RustcConversionSuggestion, @@ -1284,6 +1281,9 @@ pub enum AttributeKind { /// Represents `#[rustc_effective_visibility]`. RustcEffectiveVisibility, + /// Implementation detail of `#[eii]` + RustcEiiForeignItem, + /// Represents `#[rustc_evaluate_where_clauses]` RustcEvaluateWhereClauses, @@ -1352,7 +1352,7 @@ pub enum AttributeKind { }, /// Represents `#[rustc_never_returns_null_ptr]` - RustcNeverReturnsNullPointer, + RustcNeverReturnsNullPtr, /// Represents `#[rustc_never_type_options]`. RustcNeverTypeOptions { diff --git a/compiler/rustc_hir/src/attrs/encode_cross_crate.rs b/compiler/rustc_hir/src/attrs/encode_cross_crate.rs index 1743eef1d8f2c..c50d38b6d673a 100644 --- a/compiler/rustc_hir/src/attrs/encode_cross_crate.rs +++ b/compiler/rustc_hir/src/attrs/encode_cross_crate.rs @@ -18,7 +18,6 @@ impl AttributeKind { match self { // tidy-alphabetical-start - Align { .. } => No, AllowInternalUnsafe(..) => Yes, AllowInternalUnstable(..) => Yes, AutomaticallyDerived(..) => Yes, @@ -36,12 +35,11 @@ impl AttributeKind { CustomMir(_, _, _) => Yes, DebuggerVisualizer(..) => No, DefaultLibAllocator => No, - Deprecation { .. } => Yes, + Deprecated { .. } => Yes, DoNotRecommend { .. } => Yes, Doc(_) => Yes, DocComment { .. } => Yes, EiiDeclaration(_) => Yes, - EiiForeignItem => No, EiiImpls(..) => No, ExportName { .. } => Yes, ExportStable => No, @@ -97,6 +95,7 @@ impl AttributeKind { RegisterTool(..) => No, Repr { .. } => No, RustcAbi { .. } => No, + RustcAlign { .. } => No, RustcAllocator => No, RustcAllocatorZeroed => No, RustcAllocatorZeroedVariant { .. } => Yes, @@ -112,7 +111,7 @@ impl AttributeKind { RustcCoinductive(..) => No, RustcConfusables { .. } => Yes, RustcConstStability { .. } => Yes, - RustcConstStabilityIndirect => No, + RustcConstStableIndirect => No, RustcConversionSuggestion => Yes, RustcDeallocator => No, RustcDefPath(..) => No, @@ -130,6 +129,7 @@ impl AttributeKind { RustcDumpVtable(..) => No, RustcDynIncompatibleTrait(..) => No, RustcEffectiveVisibility => Yes, + RustcEiiForeignItem => No, RustcEvaluateWhereClauses => Yes, RustcHasIncoherentInherentImpls => Yes, RustcHiddenTypeOfOpaques => No, @@ -150,7 +150,7 @@ impl AttributeKind { RustcMain => No, RustcMir(..) => Yes, RustcMustImplementOneOf { .. } => No, - RustcNeverReturnsNullPointer => Yes, + RustcNeverReturnsNullPtr => Yes, RustcNeverTypeOptions { .. } => No, RustcNoImplicitAutorefs => Yes, RustcNoImplicitBounds => No, diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index 960fd206041a8..373d61978439e 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -1378,7 +1378,7 @@ impl AttributeExt for Attribute { Attribute::Unparsed(u) => u.span, // FIXME: should not be needed anymore when all attrs are parsed Attribute::Parsed(AttributeKind::DocComment { span, .. }) => *span, - Attribute::Parsed(AttributeKind::Deprecation { span, .. }) => *span, + Attribute::Parsed(AttributeKind::Deprecated { span, .. }) => *span, Attribute::Parsed(AttributeKind::CfgTrace(cfgs)) => cfgs[0].1, a => panic!("can't get the span of an arbitrary parsed attribute: {a:?}"), } @@ -1420,7 +1420,7 @@ impl AttributeExt for Attribute { #[inline] fn deprecation_note(&self) -> Option { match &self { - Attribute::Parsed(AttributeKind::Deprecation { deprecation, .. }) => deprecation.note, + Attribute::Parsed(AttributeKind::Deprecated { deprecation, .. }) => deprecation.note, _ => None, } } diff --git a/compiler/rustc_hir_analysis/src/check/check.rs b/compiler/rustc_hir_analysis/src/check/check.rs index a6a1b95ce4c1a..621e91525ade3 100644 --- a/compiler/rustc_hir_analysis/src/check/check.rs +++ b/compiler/rustc_hir_analysis/src/check/check.rs @@ -977,7 +977,7 @@ pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Result<(), (0, _) => ("const", "consts", None), _ => ("type or const", "types or consts", None), }; - let name = if find_attr!(tcx, def_id, EiiForeignItem) { + let name = if find_attr!(tcx, def_id, RustcEiiForeignItem) { "externally implementable items" } else { "foreign items" diff --git a/compiler/rustc_lint/src/ptr_nulls.rs b/compiler/rustc_lint/src/ptr_nulls.rs index 18a80684fa44e..1e1bbf51fcb9b 100644 --- a/compiler/rustc_lint/src/ptr_nulls.rs +++ b/compiler/rustc_lint/src/ptr_nulls.rs @@ -72,14 +72,14 @@ fn useless_check<'a, 'tcx: 'a>( e = e.peel_blocks(); if let ExprKind::MethodCall(_, _expr, [], _) = e.kind && let Some(def_id) = cx.typeck_results().type_dependent_def_id(e.hir_id) - && find_attr!(cx.tcx, def_id, RustcNeverReturnsNullPointer) + && find_attr!(cx.tcx, def_id, RustcNeverReturnsNullPtr) && let Some(fn_name) = cx.tcx.opt_item_ident(def_id) { return Some(UselessPtrNullChecksDiag::FnRet { fn_name }); } else if let ExprKind::Call(path, _args) = e.kind && let ExprKind::Path(ref qpath) = path.kind && let Some(def_id) = cx.qpath_res(qpath, path.hir_id).opt_def_id() - && find_attr!(cx.tcx, def_id, RustcNeverReturnsNullPointer) + && find_attr!(cx.tcx, def_id, RustcNeverReturnsNullPtr) && let Some(fn_name) = cx.tcx.opt_item_ident(def_id) { return Some(UselessPtrNullChecksDiag::FnRet { fn_name }); diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs index b3dc48ea62f7f..89fbb9fd86681 100644 --- a/compiler/rustc_passes/src/check_attr.rs +++ b/compiler/rustc_passes/src/check_attr.rs @@ -179,7 +179,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> { Attribute::Parsed(AttributeKind::RustcAllowConstFnUnstable(_, first_span)) => { self.check_rustc_allow_const_fn_unstable(hir_id, *first_span, span, target) } - Attribute::Parsed(AttributeKind::Deprecation {span: attr_span, .. }) => { + Attribute::Parsed(AttributeKind::Deprecated { span: attr_span, .. }) => { self.check_deprecated(hir_id, *attr_span, target) } Attribute::Parsed(AttributeKind::TargetFeature{ attr_span, ..}) => { @@ -191,7 +191,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> { &Attribute::Parsed(AttributeKind::RustcPubTransparent(attr_span)) => { self.check_rustc_pub_transparent(attr_span, span, attrs) } - Attribute::Parsed(AttributeKind::Align { align, span: attr_span }) => { + Attribute::Parsed(AttributeKind::RustcAlign { align, span: attr_span }) => { self.check_align(*align, *attr_span) } Attribute::Parsed(AttributeKind::Naked(..)) => { @@ -253,7 +253,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> { // `#[doc]` is actually a lot more than just doc comments, so is checked below | AttributeKind::DocComment {..} | AttributeKind::EiiDeclaration { .. } - | AttributeKind::EiiForeignItem | AttributeKind::ExportName { .. } | AttributeKind::ExportStable | AttributeKind::Feature(..) @@ -308,7 +307,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> { | AttributeKind::RustcCoherenceIsCore(..) | AttributeKind::RustcCoinductive(..) | AttributeKind::RustcConfusables { .. } - | AttributeKind::RustcConstStabilityIndirect + | AttributeKind::RustcConstStableIndirect | AttributeKind::RustcConversionSuggestion | AttributeKind::RustcDeallocator | AttributeKind::RustcDefPath(..) @@ -326,6 +325,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> { | AttributeKind::RustcDumpVtable(..) | AttributeKind::RustcDynIncompatibleTrait(..) | AttributeKind::RustcEffectiveVisibility + | AttributeKind::RustcEiiForeignItem | AttributeKind::RustcEvaluateWhereClauses | AttributeKind::RustcHasIncoherentInherentImpls | AttributeKind::RustcHiddenTypeOfOpaques @@ -344,7 +344,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> { | AttributeKind::RustcMacroTransparency(_) | AttributeKind::RustcMain | AttributeKind::RustcMir(_) - | AttributeKind::RustcNeverReturnsNullPointer + | AttributeKind::RustcNeverReturnsNullPtr | AttributeKind::RustcNeverTypeOptions {..} | AttributeKind::RustcNoImplicitAutorefs | AttributeKind::RustcNoImplicitBounds diff --git a/compiler/rustc_passes/src/stability.rs b/compiler/rustc_passes/src/stability.rs index 6fd28c78740cd..97d09e39b08b8 100644 --- a/compiler/rustc_passes/src/stability.rs +++ b/compiler/rustc_passes/src/stability.rs @@ -97,7 +97,7 @@ fn annotation_kind(tcx: TyCtxt<'_>, def_id: LocalDefId) -> AnnotationKind { fn lookup_deprecation_entry(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Option { let depr = find_attr!(tcx, def_id, - Deprecation { deprecation, span: _ } => *deprecation + Deprecated { deprecation, span: _ } => *deprecation ); let Some(depr) = depr else { @@ -209,22 +209,22 @@ fn lookup_const_stability(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Option *stability); // After checking the immediate attributes, get rid of the span and compute implied // const stability: inherit feature gate from regular stability. let mut const_stab = const_stab - .map(|const_stab| ConstStability::from_partial(const_stab, const_stability_indirect)); + .map(|const_stab| ConstStability::from_partial(const_stab, const_stable_indirect)); // If this is a const fn but not annotated with stability markers, see if we can inherit // regular stability. @@ -335,7 +335,7 @@ impl<'tcx> MissingStabilityAnnotations<'tcx> { if stab.is_none() && depr.map_or(false, |d| d.attr.is_since_rustc_version()) - && let Some(span) = find_attr_span!(Deprecation) + && let Some(span) = find_attr_span!(Deprecated) { self.tcx.dcx().emit_err(errors::DeprecatedAttribute { span }); } diff --git a/src/librustdoc/json/conversions.rs b/src/librustdoc/json/conversions.rs index 599d7b10005d9..c42ea8bf1e2d1 100644 --- a/src/librustdoc/json/conversions.rs +++ b/src/librustdoc/json/conversions.rs @@ -916,7 +916,7 @@ fn maybe_from_hir_attr(attr: &hir::Attribute, item_id: ItemId, tcx: TyCtxt<'_>) }; vec![match kind { - AK::Deprecation { .. } => return Vec::new(), // Handled separately into Item::deprecation. + AK::Deprecated { .. } => return Vec::new(), // Handled separately into Item::deprecation. AK::DocComment { .. } => unreachable!("doc comments stripped out earlier"), AK::MacroExport { .. } => Attribute::MacroExport, diff --git a/src/librustdoc/passes/collect_intra_doc_links.rs b/src/librustdoc/passes/collect_intra_doc_links.rs index 1da191c903871..47a92be3ec6ef 100644 --- a/src/librustdoc/passes/collect_intra_doc_links.rs +++ b/src/librustdoc/passes/collect_intra_doc_links.rs @@ -1109,7 +1109,7 @@ impl LinkCollector<'_, '_> { // Also resolve links in the note text of `#[deprecated]`. for attr in &item.attrs.other_attrs { - let Attribute::Parsed(AttributeKind::Deprecation { span: depr_span, deprecation }) = + let Attribute::Parsed(AttributeKind::Deprecated { span: depr_span, deprecation }) = attr else { continue; @@ -1127,7 +1127,7 @@ impl LinkCollector<'_, '_> { // inlined item. // let item_id = if let Some(inline_stmt_id) = item.inline_stmt_id - && find_attr!(tcx, inline_stmt_id, Deprecation {span, ..} if span == depr_span) + && find_attr!(tcx, inline_stmt_id, Deprecated { span, ..} if span == depr_span) { inline_stmt_id.to_def_id() } else { diff --git a/tests/pretty/delegation-inherit-attributes.pp b/tests/pretty/delegation-inherit-attributes.pp index bfe5ba03c37d4..72493f557dfc2 100644 --- a/tests/pretty/delegation-inherit-attributes.pp +++ b/tests/pretty/delegation-inherit-attributes.pp @@ -22,11 +22,11 @@ fn foo_no_reason(x: usize) -> usize { x } #[attr = Cold] - #[attr = Deprecation {deprecation: Deprecation {since: Unspecified}}] + #[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}] fn bar(x: usize) -> usize { x } } -#[attr = Deprecation {deprecation: Deprecation {since: Unspecified}}] +#[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}] #[attr = MustUse {reason: "foo: some reason"}] #[attr = Inline(Hint)] fn foo1(arg0: _) -> _ { to_reuse::foo(self + 1) } @@ -35,7 +35,7 @@ #[attr = Inline(Hint)] fn foo_no_reason(arg0: _) -> _ { to_reuse::foo_no_reason(self + 1) } -#[attr = Deprecation {deprecation: Deprecation {since: Unspecified}}] +#[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}] #[attr = MustUse {reason: "some reason"}] #[attr = Inline(Hint)] fn foo2(arg0: _) -> _ { to_reuse::foo(self + 1) } diff --git a/tests/pretty/delegation-inline-attribute.pp b/tests/pretty/delegation-inline-attribute.pp index 54442a210d937..125ed1c298262 100644 --- a/tests/pretty/delegation-inline-attribute.pp +++ b/tests/pretty/delegation-inline-attribute.pp @@ -46,7 +46,7 @@ // Check that #[inline(hint)] is added when other attributes present in inner reuse #[attr = Cold] #[attr = MustUse] - #[attr = Deprecation {deprecation: Deprecation {since: Unspecified}}] + #[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}] #[attr = Inline(Hint)] fn foo1(arg0: _) -> _ { to_reuse::foo(self / 2) } @@ -62,7 +62,7 @@ #[attr = Cold] #[attr = MustUse] #[attr = Inline(Never)] - #[attr = Deprecation {deprecation: Deprecation {since: Unspecified}}] + #[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}] fn foo4(arg0: _) -> _ { to_reuse::foo(self / 2) } }.foo() } @@ -70,7 +70,7 @@ // Check that #[inline(hint)] is added when there are other attributes present in trait reuse #[attr = Cold] #[attr = MustUse] - #[attr = Deprecation {deprecation: Deprecation {since: Unspecified}}] + #[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}] #[attr = Inline(Hint)] fn foo1(self: _) -> _ { self.0.foo1() } @@ -86,7 +86,7 @@ #[attr = Cold] #[attr = MustUse] #[attr = Inline(Never)] - #[attr = Deprecation {deprecation: Deprecation {since: Unspecified}}] + #[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}] fn foo4(self: _) -> _ { self.0.foo4() } } diff --git a/tests/ui-fulldeps/internal-lints/find_attr.rs b/tests/ui-fulldeps/internal-lints/find_attr.rs index bb0c8c486bcdb..90b9b96ba54ef 100644 --- a/tests/ui-fulldeps/internal-lints/find_attr.rs +++ b/tests/ui-fulldeps/internal-lints/find_attr.rs @@ -13,7 +13,7 @@ fn main() { find_attr!(attrs, AttributeKind::Inline(..)); //~^ ERROR use of `AttributeKind` in `find_attr!(...)` invocation - find_attr!(attrs, AttributeKind::Inline{..} | AttributeKind::Deprecation {..}); + find_attr!(attrs, AttributeKind::Inline{..} | AttributeKind::Deprecated {..}); //~^ ERROR use of `AttributeKind` in `find_attr!(...)` invocation //~| ERROR use of `AttributeKind` in `find_attr!(...)` invocation diff --git a/tests/ui-fulldeps/internal-lints/find_attr.stderr b/tests/ui-fulldeps/internal-lints/find_attr.stderr index b7291ecbb84d9..8cb1003b0aa1e 100644 --- a/tests/ui-fulldeps/internal-lints/find_attr.stderr +++ b/tests/ui-fulldeps/internal-lints/find_attr.stderr @@ -15,7 +15,7 @@ LL | #![deny(rustc::bad_use_of_find_attr)] error: use of `AttributeKind` in `find_attr!(...)` invocation --> $DIR/find_attr.rs:16:23 | -LL | find_attr!(attrs, AttributeKind::Inline{..} | AttributeKind::Deprecation {..}); +LL | find_attr!(attrs, AttributeKind::Inline{..} | AttributeKind::Deprecated {..}); | ^^^^^^^^^^^^^ | = note: `find_attr!(...)` already imports `AttributeKind::*` @@ -24,7 +24,7 @@ LL | find_attr!(attrs, AttributeKind::Inline{..} | AttributeKind::Deprecatio error: use of `AttributeKind` in `find_attr!(...)` invocation --> $DIR/find_attr.rs:16:51 | -LL | find_attr!(attrs, AttributeKind::Inline{..} | AttributeKind::Deprecation {..}); +LL | find_attr!(attrs, AttributeKind::Inline{..} | AttributeKind::Deprecated {..}); | ^^^^^^^^^^^^^ | = note: `find_attr!(...)` already imports `AttributeKind::*` diff --git a/tests/ui/unpretty/deprecated-attr.stdout b/tests/ui/unpretty/deprecated-attr.stdout index 32d5cf06a3d67..4ba5b0b366df9 100644 --- a/tests/ui/unpretty/deprecated-attr.stdout +++ b/tests/ui/unpretty/deprecated-attr.stdout @@ -5,28 +5,28 @@ use ::std::prelude::rust_2015::*; //@ check-pass //@ edition: 2015 -#[attr = Deprecation {deprecation: Deprecation {since: Unspecified}}] +#[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}] struct PlainDeprecated; -#[attr = Deprecation {deprecation: Deprecation {since: Unspecified, +#[attr = Deprecated {deprecation: Deprecation {since: Unspecified, note: here's why this is deprecated#0}}] struct DirectNote; -#[attr = Deprecation {deprecation: Deprecation {since: Unspecified, +#[attr = Deprecated {deprecation: Deprecation {since: Unspecified, note: here's why this is deprecated#0}}] struct ExplicitNote; -#[attr = Deprecation {deprecation: Deprecation {since: NonStandard("1.2.3"), +#[attr = Deprecated {deprecation: Deprecation {since: NonStandard("1.2.3"), note: here's why this is deprecated#0}}] struct SinceAndNote; -#[attr = Deprecation {deprecation: Deprecation {since: NonStandard("1.2.3"), +#[attr = Deprecated {deprecation: Deprecation {since: NonStandard("1.2.3"), note: here's why this is deprecated#0}}] struct FlippedOrder; fn f() { // Attribute is ignored here (with a warning), but still preserved in HIR - #[attr = Deprecation {deprecation: Deprecation {since: Unspecified}}] + #[attr = Deprecated {deprecation: Deprecation {since: Unspecified}}] 0 }