@@ -43,11 +43,7 @@ impl<S: Stage> SingleAttributeParser<S> for CrateNameParser {
4343 const ATTRIBUTE_ORDER : AttributeOrder = AttributeOrder :: KeepOutermost ;
4444 const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: WarnButFutureError ;
4545 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 ;
5147
5248 fn convert ( cx : & mut AcceptContext < ' _ , ' _ , S > , args : & ArgParser < ' _ > ) -> Option < AttributeKind > {
5349 let ArgParser :: NameValue ( n) = args else {
@@ -76,11 +72,7 @@ impl<S: Stage> SingleAttributeParser<S> for RecursionLimitParser {
7672 const ATTRIBUTE_ORDER : AttributeOrder = AttributeOrder :: KeepOutermost ;
7773 const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: WarnButFutureError ;
7874 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 ;
8476
8577 fn convert ( cx : & mut AcceptContext < ' _ , ' _ , S > , args : & ArgParser < ' _ > ) -> Option < AttributeKind > {
8678 let ArgParser :: NameValue ( nv) = args else {
@@ -103,11 +95,7 @@ impl<S: Stage> SingleAttributeParser<S> for MoveSizeLimitParser {
10395 const ATTRIBUTE_ORDER : AttributeOrder = AttributeOrder :: KeepOutermost ;
10496 const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: Error ;
10597 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 ;
11199
112100 fn convert ( cx : & mut AcceptContext < ' _ , ' _ , S > , args : & ArgParser < ' _ > ) -> Option < AttributeKind > {
113101 let ArgParser :: NameValue ( nv) = args else {
@@ -130,11 +118,7 @@ impl<S: Stage> SingleAttributeParser<S> for TypeLengthLimitParser {
130118 const ATTRIBUTE_ORDER : AttributeOrder = AttributeOrder :: KeepOutermost ;
131119 const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: WarnButFutureError ;
132120 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 ;
138122
139123 fn convert ( cx : & mut AcceptContext < ' _ , ' _ , S > , args : & ArgParser < ' _ > ) -> Option < AttributeKind > {
140124 let ArgParser :: NameValue ( nv) = args else {
@@ -157,11 +141,7 @@ impl<S: Stage> SingleAttributeParser<S> for PatternComplexityLimitParser {
157141 const ATTRIBUTE_ORDER : AttributeOrder = AttributeOrder :: KeepOutermost ;
158142 const ON_DUPLICATE : OnDuplicate < S > = OnDuplicate :: Error ;
159143 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 ;
165145
166146 fn convert ( cx : & mut AcceptContext < ' _ , ' _ , S > , args : & ArgParser < ' _ > ) -> Option < AttributeKind > {
167147 let ArgParser :: NameValue ( nv) = args else {
@@ -182,21 +162,15 @@ pub(crate) struct NoCoreParser;
182162impl < S : Stage > NoArgsAttributeParser < S > for NoCoreParser {
183163 const PATH : & [ Symbol ] = & [ sym:: no_core] ;
184164 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 ;
188166 const CREATE : fn ( Span ) -> AttributeKind = AttributeKind :: NoCore ;
189- const TYPE : AttributeType = AttributeType :: CrateLevel ;
190167}
191168
192169pub ( crate ) struct NoStdParser ;
193170
194171impl < S : Stage > NoArgsAttributeParser < S > for NoStdParser {
195172 const PATH : & [ Symbol ] = & [ sym:: no_std] ;
196173 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 ;
200175 const CREATE : fn ( Span ) -> AttributeKind = AttributeKind :: NoStd ;
201- const TYPE : AttributeType = AttributeType :: CrateLevel ;
202176}
0 commit comments