@@ -13,7 +13,8 @@ impl SingleAttributeParser for CrateNameParser {
1313 const PATH : & [ Symbol ] = & [ sym:: crate_name] ;
1414 const ON_DUPLICATE : OnDuplicate = OnDuplicate :: WarnButFutureError ;
1515 const TEMPLATE : AttributeTemplate = template ! ( NameValueStr : "name" ) ;
16- const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( & [ Allow ( Target :: Crate ) ] ) ;
16+ const ALLOWED_TARGETS : AllowedTargets =
17+ AllowedTargets :: AllowListWarnRest ( & [ Allow ( Target :: Crate ) ] ) ;
1718 const STABILITY : AttributeStability = AttributeStability :: Stable ;
1819
1920 fn convert ( cx : & mut AcceptContext < ' _ , ' _ > , args : & ArgParser ) -> Option < AttributeKind > {
@@ -31,7 +32,8 @@ impl CombineAttributeParser for CrateTypeParser {
3132 const PATH : & [ Symbol ] = & [ sym:: crate_type] ;
3233 type Item = CrateType ;
3334 const CONVERT : ConvertFn < Self :: Item > = |items, _| AttributeKind :: CrateType ( items) ;
34- const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( & [ Allow ( Target :: Crate ) ] ) ;
35+ const ALLOWED_TARGETS : AllowedTargets =
36+ AllowedTargets :: AllowListWarnRest ( & [ Allow ( Target :: Crate ) ] ) ;
3537 const TEMPLATE : AttributeTemplate =
3638 template ! ( NameValueStr : "crate type" , "https://doc.rust-lang.org/reference/linkage.html" ) ;
3739 const STABILITY : AttributeStability = AttributeStability :: Stable ;
@@ -74,7 +76,8 @@ impl SingleAttributeParser for RecursionLimitParser {
7476 const PATH : & [ Symbol ] = & [ sym:: recursion_limit] ;
7577 const ON_DUPLICATE : OnDuplicate = OnDuplicate :: WarnButFutureError ;
7678 const TEMPLATE : AttributeTemplate = template ! ( NameValueStr : "N" , "https://doc.rust-lang.org/reference/attributes/limits.html#the-recursion_limit-attribute" ) ;
77- const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( & [ Allow ( Target :: Crate ) ] ) ;
79+ const ALLOWED_TARGETS : AllowedTargets =
80+ AllowedTargets :: AllowListWarnRest ( & [ Allow ( Target :: Crate ) ] ) ;
7881 const STABILITY : AttributeStability = AttributeStability :: Stable ;
7982
8083 fn convert ( cx : & mut AcceptContext < ' _ , ' _ > , args : & ArgParser ) -> Option < AttributeKind > {
@@ -105,7 +108,8 @@ impl SingleAttributeParser for TypeLengthLimitParser {
105108 const PATH : & [ Symbol ] = & [ sym:: type_length_limit] ;
106109 const ON_DUPLICATE : OnDuplicate = OnDuplicate :: WarnButFutureError ;
107110 const TEMPLATE : AttributeTemplate = template ! ( NameValueStr : "N" ) ;
108- const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( & [ Allow ( Target :: Crate ) ] ) ;
111+ const ALLOWED_TARGETS : AllowedTargets =
112+ AllowedTargets :: AllowListWarnRest ( & [ Allow ( Target :: Crate ) ] ) ;
109113 const STABILITY : AttributeStability = AttributeStability :: Stable ;
110114
111115 fn convert ( cx : & mut AcceptContext < ' _ , ' _ > , args : & ArgParser ) -> Option < AttributeKind > {
@@ -147,7 +151,8 @@ pub(crate) struct NoStdParser;
147151impl NoArgsAttributeParser for NoStdParser {
148152 const PATH : & [ Symbol ] = & [ sym:: no_std] ;
149153 const ON_DUPLICATE : OnDuplicate = OnDuplicate :: Warn ;
150- const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( & [ Allow ( Target :: Crate ) ] ) ;
154+ const ALLOWED_TARGETS : AllowedTargets =
155+ AllowedTargets :: AllowListWarnRest ( & [ Allow ( Target :: Crate ) ] ) ;
151156 const STABILITY : AttributeStability = AttributeStability :: Stable ;
152157 const CREATE : fn ( Span ) -> AttributeKind = |_| AttributeKind :: NoStd ;
153158}
@@ -157,7 +162,8 @@ pub(crate) struct NoMainParser;
157162impl NoArgsAttributeParser for NoMainParser {
158163 const PATH : & [ Symbol ] = & [ sym:: no_main] ;
159164 const ON_DUPLICATE : OnDuplicate = OnDuplicate :: Warn ;
160- const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( & [ Allow ( Target :: Crate ) ] ) ;
165+ const ALLOWED_TARGETS : AllowedTargets =
166+ AllowedTargets :: AllowListWarnRest ( & [ Allow ( Target :: Crate ) ] ) ;
161167 const STABILITY : AttributeStability = AttributeStability :: Stable ;
162168 const CREATE : fn ( Span ) -> AttributeKind = |_| AttributeKind :: NoMain ;
163169}
@@ -176,7 +182,8 @@ pub(crate) struct WindowsSubsystemParser;
176182impl SingleAttributeParser for WindowsSubsystemParser {
177183 const PATH : & [ Symbol ] = & [ sym:: windows_subsystem] ;
178184 const ON_DUPLICATE : OnDuplicate = OnDuplicate :: WarnButFutureError ;
179- const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( & [ Allow ( Target :: Crate ) ] ) ;
185+ const ALLOWED_TARGETS : AllowedTargets =
186+ AllowedTargets :: AllowListWarnRest ( & [ Allow ( Target :: Crate ) ] ) ;
180187 const TEMPLATE : AttributeTemplate = template ! ( NameValueStr : [ "windows" , "console" ] , "https://doc.rust-lang.org/reference/runtime.html#the-windows_subsystem-attribute" ) ;
181188 const STABILITY : AttributeStability = AttributeStability :: Stable ;
182189
@@ -231,7 +238,8 @@ pub(crate) struct NoBuiltinsParser;
231238impl NoArgsAttributeParser for NoBuiltinsParser {
232239 const PATH : & [ Symbol ] = & [ sym:: no_builtins] ;
233240 const ON_DUPLICATE : OnDuplicate = OnDuplicate :: Warn ;
234- const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( & [ Allow ( Target :: Crate ) ] ) ;
241+ const ALLOWED_TARGETS : AllowedTargets =
242+ AllowedTargets :: AllowListWarnRest ( & [ Allow ( Target :: Crate ) ] ) ;
235243 const STABILITY : AttributeStability = AttributeStability :: Stable ;
236244 const CREATE : fn ( Span ) -> AttributeKind = |_| AttributeKind :: NoBuiltins ;
237245}
@@ -269,7 +277,8 @@ impl CombineAttributeParser for FeatureParser {
269277 const PATH : & [ Symbol ] = & [ sym:: feature] ;
270278 type Item = Ident ;
271279 const CONVERT : ConvertFn < Self :: Item > = AttributeKind :: Feature ;
272- const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( & [ Allow ( Target :: Crate ) ] ) ;
280+ const ALLOWED_TARGETS : AllowedTargets =
281+ AllowedTargets :: AllowListWarnRest ( & [ Allow ( Target :: Crate ) ] ) ;
273282 const TEMPLATE : AttributeTemplate = template ! ( List : & [ "feature1, feature2, ..." ] ) ;
274283 const STABILITY : AttributeStability = AttributeStability :: Stable ;
275284
0 commit comments