@@ -278,25 +278,35 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
278278 ungated ! ( cfg_attr, Normal , template!( List : "predicate, attr1, attr2, ..." ) , DuplicatesOk ) ,
279279
280280 // Testing:
281- ungated ! ( ignore, Normal , template!( Word , NameValueStr : "reason" ) , WarnFollowing ) ,
281+ ungated ! (
282+ ignore, Normal , template!( Word , NameValueStr : "reason" ) , WarnFollowing ,
283+ @only_local: true ,
284+ ) ,
282285 ungated ! (
283286 should_panic, Normal ,
284287 template!( Word , List : r#"expected = "reason""# , NameValueStr : "reason" ) , FutureWarnFollowing ,
288+ @only_local: true ,
285289 ) ,
286290 // FIXME(Centril): This can be used on stable but shouldn't.
287- ungated ! ( reexport_test_harness_main, CrateLevel , template!( NameValueStr : "name" ) , ErrorFollowing ) ,
291+ ungated ! (
292+ reexport_test_harness_main, CrateLevel , template!( NameValueStr : "name" ) , ErrorFollowing ,
293+ @only_local: true ,
294+ ) ,
288295
289296 // Macros:
290297 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`.
298+ ungated ! (
299+ macro_use, Normal , template!( Word , List : "name1, name2, ..." ) , WarnFollowingWordOnly ,
300+ @only_local: true ,
301+ ) ,
302+ ungated ! ( macro_escape, Normal , template!( Word ) , WarnFollowing , @only_local: true ) , // Deprecated synonym for `macro_use`.
293303 ungated ! ( macro_export, Normal , template!( Word , List : "local_inner_macros" ) , WarnFollowing ) ,
294- ungated ! ( proc_macro, Normal , template!( Word ) , ErrorFollowing ) ,
304+ ungated ! ( proc_macro, Normal , template!( Word ) , ErrorFollowing , @only_local : true ) ,
295305 ungated ! (
296- proc_macro_derive, Normal ,
297- template! ( List : "TraitName, /*opt*/ attributes(name1, name2, ...)" ) , ErrorFollowing ,
306+ proc_macro_derive, Normal , template! ( List : "TraitName, /*opt*/ attributes(name1, name2, ...)" ) ,
307+ ErrorFollowing , @only_local : true ,
298308 ) ,
299- ungated ! ( proc_macro_attribute, Normal , template!( Word ) , ErrorFollowing ) ,
309+ ungated ! ( proc_macro_attribute, Normal , template!( Word ) , ErrorFollowing , @only_local : true ) ,
300310
301311 // Lints:
302312 ungated ! (
@@ -309,7 +319,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
309319 ) ,
310320 gated ! (
311321 expect, Normal , template!( List : r#"lint1, lint2, ..., /*opt*/ reason = "...""# ) , DuplicatesOk ,
312- lint_reasons, experimental!( expect)
322+ @only_local : true , lint_reasons, experimental!( expect)
313323 ) ,
314324 ungated ! (
315325 forbid, Normal , template!( List : r#"lint1, lint2, ..., /*opt*/ reason = "...""# ) ,
@@ -335,32 +345,48 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
335345 ) ,
336346
337347 // Crate properties:
338- ungated ! ( crate_name, CrateLevel , template!( NameValueStr : "name" ) , FutureWarnFollowing ) ,
339- ungated ! ( crate_type, CrateLevel , template!( NameValueStr : "bin|lib|..." ) , DuplicatesOk ) ,
348+ ungated ! (
349+ crate_name, CrateLevel , template!( NameValueStr : "name" ) , FutureWarnFollowing ,
350+ @only_local: true ,
351+ ) ,
352+ ungated ! (
353+ crate_type, CrateLevel , template!( NameValueStr : "bin|lib|..." ) , DuplicatesOk ,
354+ @only_local: true ,
355+ ) ,
340356 // crate_id is deprecated
341- ungated ! ( crate_id, CrateLevel , template!( NameValueStr : "ignored" ) , FutureWarnFollowing ) ,
357+ ungated ! (
358+ crate_id, CrateLevel , template!( NameValueStr : "ignored" ) , FutureWarnFollowing ,
359+ @only_local: true ,
360+ ) ,
342361
343362 // ABI, linking, symbols, and FFI
344363 ungated ! (
345364 link, Normal ,
346365 template!( List : r#"name = "...", /*opt*/ kind = "dylib|static|...", /*opt*/ wasm_import_module = "...", /*opt*/ import_name_type = "decorated|noprefix|undecorated""# ) ,
347366 DuplicatesOk ,
367+ @only_local: true ,
348368 ) ,
349369 ungated ! ( link_name, Normal , template!( NameValueStr : "name" ) , FutureWarnPreceding ) ,
350- ungated ! ( no_link, Normal , template!( Word ) , WarnFollowing ) ,
370+ ungated ! ( no_link, Normal , template!( Word ) , WarnFollowing , @only_local : true ) ,
351371 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 ) ,
372+ ungated ! ( export_name, Normal , template!( NameValueStr : "name" ) , FutureWarnPreceding , @only_local : true ) ,
373+ ungated ! ( link_section, Normal , template!( NameValueStr : "name" ) , FutureWarnPreceding , @only_local : true ) ,
354374 ungated ! ( no_mangle, Normal , template!( Word ) , WarnFollowing , @only_local: true ) ,
355375 ungated ! ( used, Normal , template!( Word , List : "compiler|linker" ) , WarnFollowing , @only_local: true ) ,
356376 ungated ! ( link_ordinal, Normal , template!( List : "ordinal" ) , ErrorPreceding ) ,
357377
358378 // Limits:
359- ungated ! ( recursion_limit, CrateLevel , template!( NameValueStr : "N" ) , FutureWarnFollowing ) ,
360- ungated ! ( type_length_limit, CrateLevel , template!( NameValueStr : "N" ) , FutureWarnFollowing ) ,
379+ ungated ! (
380+ recursion_limit, CrateLevel , template!( NameValueStr : "N" ) , FutureWarnFollowing ,
381+ @only_local: true
382+ ) ,
383+ ungated ! (
384+ type_length_limit, CrateLevel , template!( NameValueStr : "N" ) , FutureWarnFollowing ,
385+ @only_local: true
386+ ) ,
361387 gated ! (
362388 move_size_limit, CrateLevel , template!( NameValueStr : "N" ) , ErrorFollowing ,
363- large_assignments, experimental!( move_size_limit)
389+ @only_local : true , large_assignments, experimental!( move_size_limit)
364390 ) ,
365391
366392 // Entry point:
0 commit comments