@@ -43,11 +43,7 @@ impl<S: Stage> SingleAttributeParser<S> for CrateNameParser {
43
43
const ATTRIBUTE_ORDER : AttributeOrder = AttributeOrder :: KeepOutermost ;
44
44
const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: WarnButFutureError ;
45
45
const TEMPLATE : AttributeTemplate = template ! ( NameValueStr : "name" ) ;
46
- const TYPE : AttributeType = AttributeType :: CrateLevel ;
47
-
48
- // because it's a crate-level attribute, we already warn about it.
49
- // Putting target limitations here would give duplicate warnings
50
- const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( ALL_TARGETS ) ;
46
+ const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: CrateLevel ;
51
47
52
48
fn convert ( cx : & mut AcceptContext < ' _ , ' _ , S > , args : & ArgParser < ' _ > ) -> Option < AttributeKind > {
53
49
let ArgParser :: NameValue ( n) = args else {
@@ -76,11 +72,7 @@ impl<S: Stage> SingleAttributeParser<S> for RecursionLimitParser {
76
72
const ATTRIBUTE_ORDER : AttributeOrder = AttributeOrder :: KeepOutermost ;
77
73
const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: WarnButFutureError ;
78
74
const TEMPLATE : AttributeTemplate = template ! ( NameValueStr : "N" , "https://doc.rust-lang.org/reference/attributes/limits.html#the-recursion_limit-attribute" ) ;
79
- const TYPE : AttributeType = AttributeType :: CrateLevel ;
80
-
81
- // because it's a crate-level attribute, we already warn about it.
82
- // Putting target limitations here would give duplicate warnings
83
- const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( ALL_TARGETS ) ;
75
+ const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: CrateLevel ;
84
76
85
77
fn convert ( cx : & mut AcceptContext < ' _ , ' _ , S > , args : & ArgParser < ' _ > ) -> Option < AttributeKind > {
86
78
let ArgParser :: NameValue ( nv) = args else {
@@ -103,11 +95,7 @@ impl<S: Stage> SingleAttributeParser<S> for MoveSizeLimitParser {
103
95
const ATTRIBUTE_ORDER : AttributeOrder = AttributeOrder :: KeepOutermost ;
104
96
const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: Error ;
105
97
const TEMPLATE : AttributeTemplate = template ! ( NameValueStr : "N" ) ;
106
- const TYPE : AttributeType = AttributeType :: CrateLevel ;
107
-
108
- // because it's a crate-level attribute, we already warn about it.
109
- // Putting target limitations here would give duplicate warnings
110
- const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( ALL_TARGETS ) ;
98
+ const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: CrateLevel ;
111
99
112
100
fn convert ( cx : & mut AcceptContext < ' _ , ' _ , S > , args : & ArgParser < ' _ > ) -> Option < AttributeKind > {
113
101
let ArgParser :: NameValue ( nv) = args else {
@@ -130,11 +118,7 @@ impl<S: Stage> SingleAttributeParser<S> for TypeLengthLimitParser {
130
118
const ATTRIBUTE_ORDER : AttributeOrder = AttributeOrder :: KeepOutermost ;
131
119
const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: WarnButFutureError ;
132
120
const TEMPLATE : AttributeTemplate = template ! ( NameValueStr : "N" ) ;
133
- const TYPE : AttributeType = AttributeType :: CrateLevel ;
134
-
135
- // because it's a crate-level attribute, we already warn about it.
136
- // Putting target limitations here would give duplicate warnings
137
- const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( ALL_TARGETS ) ;
121
+ const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: CrateLevel ;
138
122
139
123
fn convert ( cx : & mut AcceptContext < ' _ , ' _ , S > , args : & ArgParser < ' _ > ) -> Option < AttributeKind > {
140
124
let ArgParser :: NameValue ( nv) = args else {
@@ -157,11 +141,7 @@ impl<S: Stage> SingleAttributeParser<S> for PatternComplexityLimitParser {
157
141
const ATTRIBUTE_ORDER : AttributeOrder = AttributeOrder :: KeepOutermost ;
158
142
const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: Error ;
159
143
const TEMPLATE : AttributeTemplate = template ! ( NameValueStr : "N" ) ;
160
- const TYPE : AttributeType = AttributeType :: CrateLevel ;
161
-
162
- // because it's a crate-level attribute, we already warn about it.
163
- // Putting target limitations here would give duplicate warnings
164
- const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( ALL_TARGETS ) ;
144
+ const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: CrateLevel ;
165
145
166
146
fn convert ( cx : & mut AcceptContext < ' _ , ' _ , S > , args : & ArgParser < ' _ > ) -> Option < AttributeKind > {
167
147
let ArgParser :: NameValue ( nv) = args else {
@@ -182,21 +162,15 @@ pub(crate) struct NoCoreParser;
182
162
impl < S : Stage > NoArgsAttributeParser < S > for NoCoreParser {
183
163
const PATH : & [ Symbol ] = & [ sym:: no_core] ;
184
164
const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: Warn ;
185
- // because it's a crate-level attribute, we already warn about it.
186
- // Putting target limitations here would give duplicate warnings
187
- const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( ALL_TARGETS ) ;
165
+ const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: CrateLevel ;
188
166
const CREATE : fn ( Span ) -> AttributeKind = AttributeKind :: NoCore ;
189
- const TYPE : AttributeType = AttributeType :: CrateLevel ;
190
167
}
191
168
192
169
pub ( crate ) struct NoStdParser ;
193
170
194
171
impl < S : Stage > NoArgsAttributeParser < S > for NoStdParser {
195
172
const PATH : & [ Symbol ] = & [ sym:: no_std] ;
196
173
const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: Warn ;
197
- // because it's a crate-level attribute, we already warn about it.
198
- // Putting target limitations here would give duplicate warnings
199
- const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( ALL_TARGETS ) ;
174
+ const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: CrateLevel ;
200
175
const CREATE : fn ( Span ) -> AttributeKind = AttributeKind :: NoStd ;
201
- const TYPE : AttributeType = AttributeType :: CrateLevel ;
202
176
}
0 commit comments