@@ -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,11 +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] ;
57
+ pub ( crate ) struct ParenSugarParser ;
58
+ impl < S : Stage > NoArgsAttributeParser < S > for ParenSugarParser {
59
+ const PATH : & [ Symbol ] = & [ sym:: rustc_paren_sugar] ;
60
+ const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: Error ;
61
+ const CREATE : fn ( Span ) -> AttributeKind = AttributeKind :: ParenSugar ;
62
+ }
63
+
64
+ pub ( crate ) struct TypeConstParser ;
65
+ impl < S : Stage > NoArgsAttributeParser < S > for TypeConstParser {
66
+ const PATH : & [ Symbol ] = & [ sym:: type_const] ;
67
+ const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: Error ;
68
+ const CREATE : fn ( Span ) -> AttributeKind = AttributeKind :: TypeConst ;
69
+ }
70
+
71
+ // Markers
72
+
73
+ pub ( crate ) struct MarkerParser ;
74
+ impl < S : Stage > NoArgsAttributeParser < S > for MarkerParser {
75
+ const PATH : & [ Symbol ] = & [ sym:: marker] ;
61
76
const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: Warn ;
62
- const CREATE : fn ( Span ) -> AttributeKind = AttributeKind :: ConstTrait ;
77
+ const CREATE : fn ( Span ) -> AttributeKind = AttributeKind :: Marker ;
63
78
}
64
79
65
80
pub ( crate ) struct DenyExplicitImplParser ;
@@ -76,20 +91,17 @@ impl<S: Stage> NoArgsAttributeParser<S> for DoNotImplementViaObjectParser {
76
91
const CREATE : fn ( Span ) -> AttributeKind = AttributeKind :: DoNotImplementViaObject ;
77
92
}
78
93
79
- pub ( crate ) struct CoinductiveParser ;
80
- impl < S : Stage > NoArgsAttributeParser < S > for CoinductiveParser {
81
- const PATH : & [ Symbol ] = & [ sym:: rustc_coinductive] ;
82
- const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: Error ;
83
- const CREATE : fn ( Span ) -> AttributeKind = AttributeKind :: Coinductive ;
84
- }
94
+ // Const traits
85
95
86
- pub ( crate ) struct TypeConstParser ;
87
- impl < S : Stage > NoArgsAttributeParser < S > for TypeConstParser {
88
- const PATH : & [ Symbol ] = & [ sym:: type_const ] ;
89
- const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: Error ;
90
- const CREATE : fn ( Span ) -> AttributeKind = AttributeKind :: TypeConst ;
96
+ pub ( crate ) struct ConstTraitParser ;
97
+ impl < S : Stage > NoArgsAttributeParser < S > for ConstTraitParser {
98
+ const PATH : & [ Symbol ] = & [ sym:: const_trait ] ;
99
+ const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: Warn ;
100
+ const CREATE : fn ( Span ) -> AttributeKind = AttributeKind :: ConstTrait ;
91
101
}
92
102
103
+ // Specialization
104
+
93
105
pub ( crate ) struct SpecializationTraitParser ;
94
106
impl < S : Stage > NoArgsAttributeParser < S > for SpecializationTraitParser {
95
107
const PATH : & [ Symbol ] = & [ sym:: rustc_specialization_trait] ;
@@ -104,11 +116,13 @@ impl<S: Stage> NoArgsAttributeParser<S> for UnsafeSpecializationMarkerParser {
104
116
const CREATE : fn ( Span ) -> AttributeKind = AttributeKind :: UnsafeSpecializationMarker ;
105
117
}
106
118
107
- pub ( crate ) struct MarkerParser ;
108
- impl < S : Stage > NoArgsAttributeParser < S > for MarkerParser {
109
- const PATH : & [ Symbol ] = & [ sym:: marker] ;
110
- const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: Warn ;
111
- const CREATE : fn ( Span ) -> AttributeKind = AttributeKind :: Marker ;
119
+ // Coherence
120
+
121
+ pub ( crate ) struct CoinductiveParser ;
122
+ impl < S : Stage > NoArgsAttributeParser < S > for CoinductiveParser {
123
+ const PATH : & [ Symbol ] = & [ sym:: rustc_coinductive] ;
124
+ const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: Error ;
125
+ const CREATE : fn ( Span ) -> AttributeKind = AttributeKind :: Coinductive ;
112
126
}
113
127
114
128
pub ( crate ) struct FundamentalParser ;
@@ -117,10 +131,3 @@ impl<S: Stage> NoArgsAttributeParser<S> for FundamentalParser {
117
131
const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: Error ;
118
132
const CREATE : fn ( Span ) -> AttributeKind = |_| AttributeKind :: Fundamental ;
119
133
}
120
-
121
- pub ( crate ) struct ParenSugarParser ;
122
- impl < S : Stage > NoArgsAttributeParser < S > for ParenSugarParser {
123
- const PATH : & [ Symbol ] = & [ sym:: rustc_paren_sugar] ;
124
- const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: Error ;
125
- const CREATE : fn ( Span ) -> AttributeKind = AttributeKind :: ParenSugar ;
126
- }
0 commit comments