@@ -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 > {
@@ -89,7 +92,8 @@ pub(crate) struct MoveSizeLimitParser;
8992impl SingleAttributeParser for MoveSizeLimitParser {
9093 const PATH : & [ Symbol ] = & [ sym:: move_size_limit] ;
9194 const TEMPLATE : AttributeTemplate = template ! ( NameValueStr : "N" ) ;
92- const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( & [ Allow ( Target :: Crate ) ] ) ;
95+ const ALLOWED_TARGETS : AllowedTargets =
96+ AllowedTargets :: AllowListWarnRest ( & [ Allow ( Target :: Crate ) ] ) ;
9397 const STABILITY : AttributeStability = unstable ! ( large_assignments) ;
9498
9599 fn convert ( cx : & mut AcceptContext < ' _ , ' _ > , args : & ArgParser ) -> Option < AttributeKind > {
@@ -105,7 +109,8 @@ impl SingleAttributeParser for TypeLengthLimitParser {
105109 const PATH : & [ Symbol ] = & [ sym:: type_length_limit] ;
106110 const ON_DUPLICATE : OnDuplicate = OnDuplicate :: WarnButFutureError ;
107111 const TEMPLATE : AttributeTemplate = template ! ( NameValueStr : "N" ) ;
108- const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( & [ Allow ( Target :: Crate ) ] ) ;
112+ const ALLOWED_TARGETS : AllowedTargets =
113+ AllowedTargets :: AllowListWarnRest ( & [ Allow ( Target :: Crate ) ] ) ;
109114 const STABILITY : AttributeStability = AttributeStability :: Stable ;
110115
111116 fn convert ( cx : & mut AcceptContext < ' _ , ' _ > , args : & ArgParser ) -> Option < AttributeKind > {
@@ -120,7 +125,8 @@ pub(crate) struct PatternComplexityLimitParser;
120125impl SingleAttributeParser for PatternComplexityLimitParser {
121126 const PATH : & [ Symbol ] = & [ sym:: pattern_complexity_limit] ;
122127 const TEMPLATE : AttributeTemplate = template ! ( NameValueStr : "N" ) ;
123- const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( & [ Allow ( Target :: Crate ) ] ) ;
128+ const ALLOWED_TARGETS : AllowedTargets =
129+ AllowedTargets :: AllowListWarnRest ( & [ Allow ( Target :: Crate ) ] ) ;
124130 const STABILITY : AttributeStability = unstable ! (
125131 rustc_attrs,
126132 "the `#[pattern_complexity_limit]` attribute is used for rustc unit tests"
@@ -137,7 +143,8 @@ pub(crate) struct NoCoreParser;
137143
138144impl NoArgsAttributeParser for NoCoreParser {
139145 const PATH : & [ Symbol ] = & [ sym:: no_core] ;
140- const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( & [ Allow ( Target :: Crate ) ] ) ;
146+ const ALLOWED_TARGETS : AllowedTargets =
147+ AllowedTargets :: AllowListWarnRest ( & [ Allow ( Target :: Crate ) ] ) ;
141148 const STABILITY : AttributeStability = unstable ! ( no_core) ;
142149 const CREATE : fn ( Span ) -> AttributeKind = |_| AttributeKind :: NoCore ;
143150}
@@ -147,7 +154,8 @@ pub(crate) struct NoStdParser;
147154impl NoArgsAttributeParser for NoStdParser {
148155 const PATH : & [ Symbol ] = & [ sym:: no_std] ;
149156 const ON_DUPLICATE : OnDuplicate = OnDuplicate :: Warn ;
150- const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( & [ Allow ( Target :: Crate ) ] ) ;
157+ const ALLOWED_TARGETS : AllowedTargets =
158+ AllowedTargets :: AllowListWarnRest ( & [ Allow ( Target :: Crate ) ] ) ;
151159 const STABILITY : AttributeStability = AttributeStability :: Stable ;
152160 const CREATE : fn ( Span ) -> AttributeKind = |_| AttributeKind :: NoStd ;
153161}
@@ -157,7 +165,8 @@ pub(crate) struct NoMainParser;
157165impl NoArgsAttributeParser for NoMainParser {
158166 const PATH : & [ Symbol ] = & [ sym:: no_main] ;
159167 const ON_DUPLICATE : OnDuplicate = OnDuplicate :: Warn ;
160- const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( & [ Allow ( Target :: Crate ) ] ) ;
168+ const ALLOWED_TARGETS : AllowedTargets =
169+ AllowedTargets :: AllowListWarnRest ( & [ Allow ( Target :: Crate ) ] ) ;
161170 const STABILITY : AttributeStability = AttributeStability :: Stable ;
162171 const CREATE : fn ( Span ) -> AttributeKind = |_| AttributeKind :: NoMain ;
163172}
@@ -166,7 +175,8 @@ pub(crate) struct RustcCoherenceIsCoreParser;
166175
167176impl NoArgsAttributeParser for RustcCoherenceIsCoreParser {
168177 const PATH : & [ Symbol ] = & [ sym:: rustc_coherence_is_core] ;
169- const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( & [ Allow ( Target :: Crate ) ] ) ;
178+ const ALLOWED_TARGETS : AllowedTargets =
179+ AllowedTargets :: AllowListWarnRest ( & [ Allow ( Target :: Crate ) ] ) ;
170180 const STABILITY : AttributeStability = unstable ! ( rustc_attrs) ;
171181 const CREATE : fn ( Span ) -> AttributeKind = |_| AttributeKind :: RustcCoherenceIsCore ;
172182}
@@ -176,7 +186,8 @@ pub(crate) struct WindowsSubsystemParser;
176186impl SingleAttributeParser for WindowsSubsystemParser {
177187 const PATH : & [ Symbol ] = & [ sym:: windows_subsystem] ;
178188 const ON_DUPLICATE : OnDuplicate = OnDuplicate :: WarnButFutureError ;
179- const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( & [ Allow ( Target :: Crate ) ] ) ;
189+ const ALLOWED_TARGETS : AllowedTargets =
190+ AllowedTargets :: AllowListWarnRest ( & [ Allow ( Target :: Crate ) ] ) ;
180191 const TEMPLATE : AttributeTemplate = template ! ( NameValueStr : [ "windows" , "console" ] , "https://doc.rust-lang.org/reference/runtime.html#the-windows_subsystem-attribute" ) ;
181192 const STABILITY : AttributeStability = AttributeStability :: Stable ;
182193
@@ -203,7 +214,8 @@ pub(crate) struct PanicRuntimeParser;
203214
204215impl NoArgsAttributeParser for PanicRuntimeParser {
205216 const PATH : & [ Symbol ] = & [ sym:: panic_runtime] ;
206- const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( & [ Allow ( Target :: Crate ) ] ) ;
217+ const ALLOWED_TARGETS : AllowedTargets =
218+ AllowedTargets :: AllowListWarnRest ( & [ Allow ( Target :: Crate ) ] ) ;
207219 const STABILITY : AttributeStability = unstable ! ( panic_runtime) ;
208220 const CREATE : fn ( Span ) -> AttributeKind = |_| AttributeKind :: PanicRuntime ;
209221}
@@ -212,7 +224,8 @@ pub(crate) struct NeedsPanicRuntimeParser;
212224
213225impl NoArgsAttributeParser for NeedsPanicRuntimeParser {
214226 const PATH : & [ Symbol ] = & [ sym:: needs_panic_runtime] ;
215- const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( & [ Allow ( Target :: Crate ) ] ) ;
227+ const ALLOWED_TARGETS : AllowedTargets =
228+ AllowedTargets :: AllowListWarnRest ( & [ Allow ( Target :: Crate ) ] ) ;
216229 const STABILITY : AttributeStability = unstable ! ( needs_panic_runtime) ;
217230 const CREATE : fn ( Span ) -> AttributeKind = |_| AttributeKind :: NeedsPanicRuntime ;
218231}
@@ -221,7 +234,8 @@ pub(crate) struct ProfilerRuntimeParser;
221234
222235impl NoArgsAttributeParser for ProfilerRuntimeParser {
223236 const PATH : & [ Symbol ] = & [ sym:: profiler_runtime] ;
224- const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( & [ Allow ( Target :: Crate ) ] ) ;
237+ const ALLOWED_TARGETS : AllowedTargets =
238+ AllowedTargets :: AllowListWarnRest ( & [ Allow ( Target :: Crate ) ] ) ;
225239 const STABILITY : AttributeStability = unstable ! ( profiler_runtime) ;
226240 const CREATE : fn ( Span ) -> AttributeKind = |_| AttributeKind :: ProfilerRuntime ;
227241}
@@ -231,7 +245,8 @@ pub(crate) struct NoBuiltinsParser;
231245impl NoArgsAttributeParser for NoBuiltinsParser {
232246 const PATH : & [ Symbol ] = & [ sym:: no_builtins] ;
233247 const ON_DUPLICATE : OnDuplicate = OnDuplicate :: Warn ;
234- const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( & [ Allow ( Target :: Crate ) ] ) ;
248+ const ALLOWED_TARGETS : AllowedTargets =
249+ AllowedTargets :: AllowListWarnRest ( & [ Allow ( Target :: Crate ) ] ) ;
235250 const STABILITY : AttributeStability = AttributeStability :: Stable ;
236251 const CREATE : fn ( Span ) -> AttributeKind = |_| AttributeKind :: NoBuiltins ;
237252}
@@ -240,7 +255,8 @@ pub(crate) struct RustcPreserveUbChecksParser;
240255
241256impl NoArgsAttributeParser for RustcPreserveUbChecksParser {
242257 const PATH : & [ Symbol ] = & [ sym:: rustc_preserve_ub_checks] ;
243- const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( & [ Allow ( Target :: Crate ) ] ) ;
258+ const ALLOWED_TARGETS : AllowedTargets =
259+ AllowedTargets :: AllowListWarnRest ( & [ Allow ( Target :: Crate ) ] ) ;
244260 const STABILITY : AttributeStability = unstable ! ( rustc_attrs) ;
245261 const CREATE : fn ( Span ) -> AttributeKind = |_| AttributeKind :: RustcPreserveUbChecks ;
246262}
@@ -249,7 +265,8 @@ pub(crate) struct RustcNoImplicitBoundsParser;
249265
250266impl NoArgsAttributeParser for RustcNoImplicitBoundsParser {
251267 const PATH : & [ Symbol ] = & [ sym:: rustc_no_implicit_bounds] ;
252- const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( & [ Allow ( Target :: Crate ) ] ) ;
268+ const ALLOWED_TARGETS : AllowedTargets =
269+ AllowedTargets :: AllowListWarnRest ( & [ Allow ( Target :: Crate ) ] ) ;
253270 const STABILITY : AttributeStability = unstable ! ( rustc_attrs) ;
254271 const CREATE : fn ( Span ) -> AttributeKind = |_| AttributeKind :: RustcNoImplicitBounds ;
255272}
@@ -258,7 +275,8 @@ pub(crate) struct DefaultLibAllocatorParser;
258275
259276impl NoArgsAttributeParser for DefaultLibAllocatorParser {
260277 const PATH : & [ Symbol ] = & [ sym:: default_lib_allocator] ;
261- const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( & [ Allow ( Target :: Crate ) ] ) ;
278+ const ALLOWED_TARGETS : AllowedTargets =
279+ AllowedTargets :: AllowListWarnRest ( & [ Allow ( Target :: Crate ) ] ) ;
262280 const STABILITY : AttributeStability = unstable ! ( allocator_internals) ;
263281 const CREATE : fn ( Span ) -> AttributeKind = |_| AttributeKind :: DefaultLibAllocator ;
264282}
@@ -269,7 +287,8 @@ impl CombineAttributeParser for FeatureParser {
269287 const PATH : & [ Symbol ] = & [ sym:: feature] ;
270288 type Item = Ident ;
271289 const CONVERT : ConvertFn < Self :: Item > = AttributeKind :: Feature ;
272- const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( & [ Allow ( Target :: Crate ) ] ) ;
290+ const ALLOWED_TARGETS : AllowedTargets =
291+ AllowedTargets :: AllowListWarnRest ( & [ Allow ( Target :: Crate ) ] ) ;
273292 const TEMPLATE : AttributeTemplate = template ! ( List : & [ "feature1, feature2, ..." ] ) ;
274293 const STABILITY : AttributeStability = AttributeStability :: Stable ;
275294
@@ -314,7 +333,8 @@ impl CombineAttributeParser for RegisterToolParser {
314333 const PATH : & [ Symbol ] = & [ sym:: register_tool] ;
315334 type Item = Ident ;
316335 const CONVERT : ConvertFn < Self :: Item > = |tools, _span| AttributeKind :: RegisterTool ( tools) ;
317- const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( & [ Allow ( Target :: Crate ) ] ) ;
336+ const ALLOWED_TARGETS : AllowedTargets =
337+ AllowedTargets :: AllowListWarnRest ( & [ Allow ( Target :: Crate ) ] ) ;
318338 const TEMPLATE : AttributeTemplate = template ! ( List : & [ "tool1, tool2, ..." ] ) ;
319339 const STABILITY : AttributeStability = unstable ! ( register_tool) ;
320340
0 commit comments