1- use rustc_hir:: Target ;
21use rustc_hir:: attrs:: AttributeKind ;
2+ use rustc_hir:: { MethodKind , Target } ;
33use rustc_span:: { Span , Symbol , sym} ;
44
55use crate :: attributes:: prelude:: Allow ;
@@ -25,6 +25,20 @@ impl<S: Stage> NoArgsAttributeParser<S> for RustcDumpDefParentsParser {
2525 const CREATE : fn ( Span ) -> AttributeKind = |_| AttributeKind :: RustcDumpDefParents ;
2626}
2727
28+ pub ( crate ) struct RustcDumpInferredOutlivesParser ;
29+
30+ impl < S : Stage > NoArgsAttributeParser < S > for RustcDumpInferredOutlivesParser {
31+ const PATH : & [ Symbol ] = & [ sym:: rustc_dump_inferred_outlives] ;
32+ const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: Warn ;
33+ const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( & [
34+ Allow ( Target :: Struct ) ,
35+ Allow ( Target :: Enum ) ,
36+ Allow ( Target :: Union ) ,
37+ Allow ( Target :: TyAlias ) ,
38+ ] ) ;
39+ const CREATE : fn ( Span ) -> AttributeKind = |_| AttributeKind :: RustcDumpInferredOutlives ;
40+ }
41+
2842pub ( crate ) struct RustcDumpItemBoundsParser ;
2943
3044impl < S : Stage > NoArgsAttributeParser < S > for RustcDumpItemBoundsParser {
@@ -34,21 +48,88 @@ impl<S: Stage> NoArgsAttributeParser<S> for RustcDumpItemBoundsParser {
3448 const CREATE : fn ( Span ) -> AttributeKind = |_| AttributeKind :: RustcDumpItemBounds ;
3549}
3650
51+ pub ( crate ) struct RustcDumpObjectLifetimeDefaultsParser ;
52+
53+ impl < S : Stage > NoArgsAttributeParser < S > for RustcDumpObjectLifetimeDefaultsParser {
54+ const PATH : & [ Symbol ] = & [ sym:: rustc_dump_object_lifetime_defaults] ;
55+ const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: Error ;
56+ const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( & [
57+ Allow ( Target :: AssocConst ) ,
58+ Allow ( Target :: AssocTy ) ,
59+ Allow ( Target :: Const ) ,
60+ Allow ( Target :: Enum ) ,
61+ Allow ( Target :: Fn ) ,
62+ Allow ( Target :: ForeignFn ) ,
63+ Allow ( Target :: Impl { of_trait : false } ) ,
64+ Allow ( Target :: Impl { of_trait : true } ) ,
65+ Allow ( Target :: Method ( MethodKind :: Inherent ) ) ,
66+ Allow ( Target :: Method ( MethodKind :: Trait { body : false } ) ) ,
67+ Allow ( Target :: Method ( MethodKind :: Trait { body : true } ) ) ,
68+ Allow ( Target :: Method ( MethodKind :: TraitImpl ) ) ,
69+ Allow ( Target :: Struct ) ,
70+ Allow ( Target :: Trait ) ,
71+ Allow ( Target :: TraitAlias ) ,
72+ Allow ( Target :: TyAlias ) ,
73+ Allow ( Target :: Union ) ,
74+ ] ) ;
75+ const CREATE : fn ( Span ) -> AttributeKind = |_| AttributeKind :: RustcDumpObjectLifetimeDefaults ;
76+ }
77+
3778pub ( crate ) struct RustcDumpPredicatesParser ;
3879
3980impl < S : Stage > NoArgsAttributeParser < S > for RustcDumpPredicatesParser {
4081 const PATH : & [ Symbol ] = & [ sym:: rustc_dump_predicates] ;
4182 const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: Error ;
4283 const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( & [
43- Allow ( Target :: Struct ) ,
84+ Allow ( Target :: AssocConst ) ,
85+ Allow ( Target :: AssocTy ) ,
86+ Allow ( Target :: Const ) ,
87+ Allow ( Target :: Delegation { mac : false } ) ,
88+ Allow ( Target :: Delegation { mac : true } ) ,
4489 Allow ( Target :: Enum ) ,
45- Allow ( Target :: Union ) ,
90+ Allow ( Target :: Fn ) ,
91+ Allow ( Target :: Impl { of_trait : false } ) ,
92+ Allow ( Target :: Impl { of_trait : true } ) ,
93+ Allow ( Target :: Method ( MethodKind :: Inherent ) ) ,
94+ Allow ( Target :: Method ( MethodKind :: Trait { body : false } ) ) ,
95+ Allow ( Target :: Method ( MethodKind :: Trait { body : true } ) ) ,
96+ Allow ( Target :: Method ( MethodKind :: TraitImpl ) ) ,
97+ Allow ( Target :: Struct ) ,
4698 Allow ( Target :: Trait ) ,
47- Allow ( Target :: AssocTy ) ,
99+ Allow ( Target :: TraitAlias ) ,
100+ Allow ( Target :: TyAlias ) ,
101+ Allow ( Target :: Union ) ,
48102 ] ) ;
49103 const CREATE : fn ( Span ) -> AttributeKind = |_| AttributeKind :: RustcDumpPredicates ;
50104}
51105
106+ pub ( crate ) struct RustcDumpVariancesParser ;
107+
108+ impl < S : Stage > NoArgsAttributeParser < S > for RustcDumpVariancesParser {
109+ const PATH : & [ Symbol ] = & [ sym:: rustc_dump_variances] ;
110+ const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: Warn ;
111+ const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( & [
112+ Allow ( Target :: Enum ) ,
113+ Allow ( Target :: Fn ) ,
114+ Allow ( Target :: Method ( MethodKind :: Inherent ) ) ,
115+ Allow ( Target :: Method ( MethodKind :: Trait { body : false } ) ) ,
116+ Allow ( Target :: Method ( MethodKind :: Trait { body : true } ) ) ,
117+ Allow ( Target :: Method ( MethodKind :: TraitImpl ) ) ,
118+ Allow ( Target :: Struct ) ,
119+ Allow ( Target :: Union ) ,
120+ ] ) ;
121+ const CREATE : fn ( Span ) -> AttributeKind = |_| AttributeKind :: RustcDumpVariances ;
122+ }
123+
124+ pub ( crate ) struct RustcDumpVariancesOfOpaquesParser ;
125+
126+ impl < S : Stage > NoArgsAttributeParser < S > for RustcDumpVariancesOfOpaquesParser {
127+ const PATH : & [ Symbol ] = & [ sym:: rustc_dump_variances_of_opaques] ;
128+ const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: Warn ;
129+ const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( & [ Allow ( Target :: Crate ) ] ) ;
130+ const CREATE : fn ( Span ) -> AttributeKind = |_| AttributeKind :: RustcDumpVariancesOfOpaques ;
131+ }
132+
52133pub ( crate ) struct RustcDumpVtableParser ;
53134
54135impl < S : Stage > NoArgsAttributeParser < S > for RustcDumpVtableParser {
0 commit comments