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