@@ -721,3 +721,60 @@ impl<S: Stage> CombineAttributeParser<S> for RustcThenThisWouldNeedParser {
721721 Some ( ident)
722722 }
723723}
724+
725+ pub ( crate ) struct RustcIntrinsicParser ;
726+
727+ impl < S : Stage > NoArgsAttributeParser < S > for RustcIntrinsicParser {
728+ const PATH : & ' static [ Symbol ] = & [ sym:: rustc_intrinsic] ;
729+ const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: Error ;
730+ const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( & [ Allow ( Target :: Fn ) ] ) ;
731+ const CREATE : fn ( Span ) -> AttributeKind = |_| AttributeKind :: RustcIntrinsic ;
732+ }
733+
734+ pub ( crate ) struct RustcIntrinsicConstStableIndirectParser ;
735+
736+ impl < S : Stage > NoArgsAttributeParser < S > for RustcIntrinsicConstStableIndirectParser {
737+ const PATH : & ' static [ Symbol ] = & [ sym:: rustc_intrinsic_const_stable_indirect] ;
738+ const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: Error ;
739+ const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( & [ Allow ( Target :: Fn ) ] ) ;
740+ const CREATE : fn ( Span ) -> AttributeKind = |_| AttributeKind :: RustcIntrinsicConstStableIndirect ;
741+ }
742+
743+ pub ( crate ) struct RustcEffectiveVisibilityParser ;
744+
745+ impl < S : Stage > NoArgsAttributeParser < S > for RustcEffectiveVisibilityParser {
746+ const PATH : & ' static [ Symbol ] = & [ sym:: rustc_effective_visibility] ;
747+ const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: Error ;
748+ const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( & [
749+ Allow ( Target :: Use ) ,
750+ Allow ( Target :: Static ) ,
751+ Allow ( Target :: Const ) ,
752+ Allow ( Target :: Fn ) ,
753+ Allow ( Target :: Closure ) ,
754+ Allow ( Target :: Mod ) ,
755+ Allow ( Target :: ForeignMod ) ,
756+ Allow ( Target :: TyAlias ) ,
757+ Allow ( Target :: Enum ) ,
758+ Allow ( Target :: Variant ) ,
759+ Allow ( Target :: Struct ) ,
760+ Allow ( Target :: Field ) ,
761+ Allow ( Target :: Union ) ,
762+ Allow ( Target :: Trait ) ,
763+ Allow ( Target :: TraitAlias ) ,
764+ Allow ( Target :: Impl { of_trait : false } ) ,
765+ Allow ( Target :: Impl { of_trait : true } ) ,
766+ Allow ( Target :: AssocConst ) ,
767+ Allow ( Target :: Method ( MethodKind :: Inherent ) ) ,
768+ Allow ( Target :: Method ( MethodKind :: Trait { body : false } ) ) ,
769+ Allow ( Target :: Method ( MethodKind :: Trait { body : true } ) ) ,
770+ Allow ( Target :: Method ( MethodKind :: TraitImpl ) ) ,
771+ Allow ( Target :: AssocTy ) ,
772+ Allow ( Target :: ForeignFn ) ,
773+ Allow ( Target :: ForeignStatic ) ,
774+ Allow ( Target :: ForeignTy ) ,
775+ Allow ( Target :: MacroDef ) ,
776+ Allow ( Target :: PatField ) ,
777+ Allow ( Target :: Crate ) ,
778+ ] ) ;
779+ const CREATE : fn ( Span ) -> AttributeKind = |_| AttributeKind :: RustcEffectiveVisibility ;
780+ }
0 commit comments