@@ -11,7 +11,6 @@ use crate::context::{AcceptContext, Stage};
11
11
use crate :: parser:: ArgParser ;
12
12
13
13
pub ( crate ) struct SkipDuringMethodDispatchParser ;
14
-
15
14
impl < S : Stage > SingleAttributeParser < S > for SkipDuringMethodDispatchParser {
16
15
const PATH : & [ Symbol ] = & [ sym:: rustc_skip_during_method_dispatch] ;
17
16
const ATTRIBUTE_ORDER : AttributeOrder = AttributeOrder :: KeepFirst ;
@@ -55,85 +54,27 @@ impl<S: Stage> SingleAttributeParser<S> for SkipDuringMethodDispatchParser {
55
54
}
56
55
}
57
56
58
- pub ( crate ) struct ConstTraitParser ;
59
- impl < S : Stage > NoArgsAttributeParser < S > for ConstTraitParser {
60
- const PATH : & [ Symbol ] = & [ sym:: const_trait] ;
61
- const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: Warn ;
57
+ impl_no_args ! ( ParenSugarParser : rustc_paren_sugar => ParenSugar / Error ) ;
58
+ impl_no_args ! ( TypeConstParser : type_const => TypeConst / Error ) ;
62
59
63
- fn create ( span : Span ) -> AttributeKind {
64
- AttributeKind :: ConstTrait ( span)
65
- }
66
- }
67
-
68
- pub ( crate ) struct DenyExplicitImplParser ;
69
- impl < S : Stage > NoArgsAttributeParser < S > for DenyExplicitImplParser {
70
- const PATH : & [ Symbol ] = & [ sym:: rustc_deny_explicit_impl] ;
71
- const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: Error ;
60
+ // Markers
72
61
73
- fn create ( span : Span ) -> AttributeKind {
74
- AttributeKind :: DenyExplicitImpl ( span)
75
- }
76
- }
77
-
78
- pub ( crate ) struct DoNotImplementViaObjectParser ;
79
- impl < S : Stage > NoArgsAttributeParser < S > for DoNotImplementViaObjectParser {
80
- const PATH : & [ Symbol ] = & [ sym:: rustc_do_not_implement_via_object] ;
81
- const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: Error ;
62
+ impl_no_args ! ( MarkerParser : marker => Marker / Error ) ;
63
+ impl_no_args ! ( DenyExplicitImplParser : rustc_deny_explicit_impl => DenyExplicitImpl / Error ) ;
64
+ impl_no_args ! ( DoNotImplementViaObjectParser : rustc_do_not_implement_via_object => DoNotImplementViaObject / Error ) ;
82
65
83
- fn create ( span : Span ) -> AttributeKind {
84
- AttributeKind :: DoNotImplementViaObject ( span)
85
- }
86
- }
66
+ // Const traits
87
67
88
- pub ( crate ) struct CoinductiveParser ;
89
- impl < S : Stage > NoArgsAttributeParser < S > for CoinductiveParser {
90
- const PATH : & [ Symbol ] = & [ sym:: rustc_coinductive] ;
91
- const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: Error ;
68
+ impl_no_args ! ( ConstTraitParser : const_trait => ConstTrait / Warn ) ;
92
69
93
- fn create ( span : Span ) -> AttributeKind {
94
- AttributeKind :: Coinductive ( span)
95
- }
96
- }
70
+ // Specialization
97
71
98
- pub ( crate ) struct TypeConstParser ;
99
- impl < S : Stage > NoArgsAttributeParser < S > for TypeConstParser {
100
- const PATH : & [ Symbol ] = & [ sym:: type_const] ;
101
- const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: Error ;
72
+ impl_no_args ! ( SpecializationTraitParser : rustc_specialization_trait => SpecializationTrait / Error ) ;
73
+ impl_no_args ! ( UnsafeSpecializationMarkerParser : rustc_unsafe_specialization_marker => UnsafeSpecializationMarker / Error ) ;
102
74
103
- fn create ( span : Span ) -> AttributeKind {
104
- AttributeKind :: TypeConst ( span)
105
- }
106
- }
75
+ // Coherence
107
76
108
- pub ( crate ) struct SpecializationTraitParser ;
109
- impl < S : Stage > NoArgsAttributeParser < S > for SpecializationTraitParser {
110
- const PATH : & [ Symbol ] = & [ sym:: rustc_specialization_trait] ;
111
- const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: Error ;
112
-
113
- fn create ( span : Span ) -> AttributeKind {
114
- AttributeKind :: SpecializationTrait ( span)
115
- }
116
- }
117
-
118
- pub ( crate ) struct UnsafeSpecializationMarkerParser ;
119
- impl < S : Stage > NoArgsAttributeParser < S > for UnsafeSpecializationMarkerParser {
120
- const PATH : & [ Symbol ] = & [ sym:: rustc_unsafe_specialization_marker] ;
121
- const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: Error ;
122
-
123
- fn create ( span : Span ) -> AttributeKind {
124
- AttributeKind :: UnsafeSpecializationMarker ( span)
125
- }
126
- }
127
-
128
- pub ( crate ) struct MarkerParser ;
129
- impl < S : Stage > NoArgsAttributeParser < S > for MarkerParser {
130
- const PATH : & [ Symbol ] = & [ sym:: marker] ;
131
- const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: Warn ;
132
-
133
- fn create ( span : Span ) -> AttributeKind {
134
- AttributeKind :: Marker ( span)
135
- }
136
- }
77
+ impl_no_args ! ( CoinductiveParser : rustc_coinductive => Coinductive / Error ) ;
137
78
138
79
pub ( crate ) struct FundamentalParser ;
139
80
impl < S : Stage > NoArgsAttributeParser < S > for FundamentalParser {
@@ -144,13 +85,3 @@ impl<S: Stage> NoArgsAttributeParser<S> for FundamentalParser {
144
85
AttributeKind :: Fundamental
145
86
}
146
87
}
147
-
148
- pub ( crate ) struct ParenSugarParser ;
149
- impl < S : Stage > NoArgsAttributeParser < S > for ParenSugarParser {
150
- const PATH : & [ Symbol ] = & [ sym:: rustc_paren_sugar] ;
151
- const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: Error ;
152
-
153
- fn create ( span : Span ) -> AttributeKind {
154
- AttributeKind :: ParenSugar ( span)
155
- }
156
- }
0 commit comments