@@ -274,29 +274,42 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
274
274
// ==========================================================================
275
275
276
276
// Conditional compilation:
277
- ungated ! ( cfg, Normal , template!( List : "predicate" ) , DuplicatesOk ) ,
278
- ungated ! ( cfg_attr, Normal , template!( List : "predicate, attr1, attr2, ..." ) , DuplicatesOk ) ,
277
+ ungated ! ( cfg, Normal , template!( List : "predicate" ) , DuplicatesOk , @only_local: true ) ,
278
+ ungated ! (
279
+ cfg_attr, Normal , template!( List : "predicate, attr1, attr2, ..." ) , DuplicatesOk ,
280
+ @only_local: true ,
281
+ ) ,
279
282
280
283
// Testing:
281
- ungated ! ( ignore, Normal , template!( Word , NameValueStr : "reason" ) , WarnFollowing ) ,
284
+ ungated ! (
285
+ ignore, Normal , template!( Word , NameValueStr : "reason" ) , WarnFollowing ,
286
+ @only_local: true ,
287
+ ) ,
282
288
ungated ! (
283
289
should_panic, Normal ,
284
290
template!( Word , List : r#"expected = "reason""# , NameValueStr : "reason" ) , FutureWarnFollowing ,
291
+ @only_local: true ,
285
292
) ,
286
293
// FIXME(Centril): This can be used on stable but shouldn't.
287
- ungated ! ( reexport_test_harness_main, CrateLevel , template!( NameValueStr : "name" ) , ErrorFollowing ) ,
294
+ ungated ! (
295
+ reexport_test_harness_main, CrateLevel , template!( NameValueStr : "name" ) , ErrorFollowing ,
296
+ @only_local: true ,
297
+ ) ,
288
298
289
299
// Macros:
290
- ungated ! ( automatically_derived, Normal , template!( Word ) , WarnFollowing ) ,
291
- ungated ! ( macro_use, Normal , template!( Word , List : "name1, name2, ..." ) , WarnFollowingWordOnly ) ,
292
- ungated ! ( macro_escape, Normal , template!( Word ) , WarnFollowing ) , // Deprecated synonym for `macro_use`.
300
+ ungated ! ( automatically_derived, Normal , template!( Word ) , WarnFollowing , @only_local: true ) ,
301
+ ungated ! (
302
+ macro_use, Normal , template!( Word , List : "name1, name2, ..." ) , WarnFollowingWordOnly ,
303
+ @only_local: true ,
304
+ ) ,
305
+ ungated ! ( macro_escape, Normal , template!( Word ) , WarnFollowing , @only_local: true ) , // Deprecated synonym for `macro_use`.
293
306
ungated ! ( macro_export, Normal , template!( Word , List : "local_inner_macros" ) , WarnFollowing ) ,
294
- ungated ! ( proc_macro, Normal , template!( Word ) , ErrorFollowing ) ,
307
+ ungated ! ( proc_macro, Normal , template!( Word ) , ErrorFollowing , @only_local : true ) ,
295
308
ungated ! (
296
- proc_macro_derive, Normal ,
297
- template! ( List : "TraitName, /*opt*/ attributes(name1, name2, ...)" ) , ErrorFollowing ,
309
+ proc_macro_derive, Normal , template! ( List : "TraitName, /*opt*/ attributes(name1, name2, ...)" ) ,
310
+ ErrorFollowing , @only_local : true ,
298
311
) ,
299
- ungated ! ( proc_macro_attribute, Normal , template!( Word ) , ErrorFollowing ) ,
312
+ ungated ! ( proc_macro_attribute, Normal , template!( Word ) , ErrorFollowing , @only_local : true ) ,
300
313
301
314
// Lints:
302
315
ungated ! (
@@ -309,7 +322,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
309
322
) ,
310
323
gated ! (
311
324
expect, Normal , template!( List : r#"lint1, lint2, ..., /*opt*/ reason = "...""# ) , DuplicatesOk ,
312
- lint_reasons, experimental!( expect)
325
+ @only_local : true , lint_reasons, experimental!( expect)
313
326
) ,
314
327
ungated ! (
315
328
forbid, Normal , template!( List : r#"lint1, lint2, ..., /*opt*/ reason = "...""# ) ,
@@ -335,32 +348,48 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
335
348
) ,
336
349
337
350
// Crate properties:
338
- ungated ! ( crate_name, CrateLevel , template!( NameValueStr : "name" ) , FutureWarnFollowing ) ,
339
- ungated ! ( crate_type, CrateLevel , template!( NameValueStr : "bin|lib|..." ) , DuplicatesOk ) ,
351
+ ungated ! (
352
+ crate_name, CrateLevel , template!( NameValueStr : "name" ) , FutureWarnFollowing ,
353
+ @only_local: true ,
354
+ ) ,
355
+ ungated ! (
356
+ crate_type, CrateLevel , template!( NameValueStr : "bin|lib|..." ) , DuplicatesOk ,
357
+ @only_local: true ,
358
+ ) ,
340
359
// crate_id is deprecated
341
- ungated ! ( crate_id, CrateLevel , template!( NameValueStr : "ignored" ) , FutureWarnFollowing ) ,
360
+ ungated ! (
361
+ crate_id, CrateLevel , template!( NameValueStr : "ignored" ) , FutureWarnFollowing ,
362
+ @only_local: true ,
363
+ ) ,
342
364
343
365
// ABI, linking, symbols, and FFI
344
366
ungated ! (
345
367
link, Normal ,
346
368
template!( List : r#"name = "...", /*opt*/ kind = "dylib|static|...", /*opt*/ wasm_import_module = "...", /*opt*/ import_name_type = "decorated|noprefix|undecorated""# ) ,
347
369
DuplicatesOk ,
370
+ @only_local: true ,
348
371
) ,
349
372
ungated ! ( link_name, Normal , template!( NameValueStr : "name" ) , FutureWarnPreceding ) ,
350
- ungated ! ( no_link, Normal , template!( Word ) , WarnFollowing ) ,
373
+ ungated ! ( no_link, Normal , template!( Word ) , WarnFollowing , @only_local : true ) ,
351
374
ungated ! ( repr, Normal , template!( List : "C" ) , DuplicatesOk , @only_local: true ) ,
352
- ungated ! ( export_name, Normal , template!( NameValueStr : "name" ) , FutureWarnPreceding ) ,
353
- ungated ! ( link_section, Normal , template!( NameValueStr : "name" ) , FutureWarnPreceding ) ,
375
+ ungated ! ( export_name, Normal , template!( NameValueStr : "name" ) , FutureWarnPreceding , @only_local : true ) ,
376
+ ungated ! ( link_section, Normal , template!( NameValueStr : "name" ) , FutureWarnPreceding , @only_local : true ) ,
354
377
ungated ! ( no_mangle, Normal , template!( Word ) , WarnFollowing , @only_local: true ) ,
355
378
ungated ! ( used, Normal , template!( Word , List : "compiler|linker" ) , WarnFollowing , @only_local: true ) ,
356
379
ungated ! ( link_ordinal, Normal , template!( List : "ordinal" ) , ErrorPreceding ) ,
357
380
358
381
// Limits:
359
- ungated ! ( recursion_limit, CrateLevel , template!( NameValueStr : "N" ) , FutureWarnFollowing ) ,
360
- ungated ! ( type_length_limit, CrateLevel , template!( NameValueStr : "N" ) , FutureWarnFollowing ) ,
382
+ ungated ! (
383
+ recursion_limit, CrateLevel , template!( NameValueStr : "N" ) , FutureWarnFollowing ,
384
+ @only_local: true
385
+ ) ,
386
+ ungated ! (
387
+ type_length_limit, CrateLevel , template!( NameValueStr : "N" ) , FutureWarnFollowing ,
388
+ @only_local: true
389
+ ) ,
361
390
gated ! (
362
391
move_size_limit, CrateLevel , template!( NameValueStr : "N" ) , ErrorFollowing ,
363
- large_assignments, experimental!( move_size_limit)
392
+ @only_local : true , large_assignments, experimental!( move_size_limit)
364
393
) ,
365
394
366
395
// Entry point:
0 commit comments