@@ -277,25 +277,35 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
277277 ungated ! ( cfg_attr, Normal , template!( List : "predicate, attr1, attr2, ..." ) , DuplicatesOk ) ,
278278
279279 // Testing:
280- ungated ! ( ignore, Normal , template!( Word , NameValueStr : "reason" ) , WarnFollowing ) ,
280+ ungated ! (
281+ ignore, Normal , template!( Word , NameValueStr : "reason" ) , WarnFollowing ,
282+ @only_local: true ,
283+ ) ,
281284 ungated ! (
282285 should_panic, Normal ,
283286 template!( Word , List : r#"expected = "reason""# , NameValueStr : "reason" ) , FutureWarnFollowing ,
287+ @only_local: true ,
284288 ) ,
285289 // FIXME(Centril): This can be used on stable but shouldn't.
286- ungated ! ( reexport_test_harness_main, CrateLevel , template!( NameValueStr : "name" ) , ErrorFollowing ) ,
290+ ungated ! (
291+ reexport_test_harness_main, CrateLevel , template!( NameValueStr : "name" ) , ErrorFollowing ,
292+ @only_local: true ,
293+ ) ,
287294
288295 // Macros:
289296 ungated ! ( automatically_derived, Normal , template!( Word ) , WarnFollowing ) ,
290- ungated ! ( macro_use, Normal , template!( Word , List : "name1, name2, ..." ) , WarnFollowingWordOnly ) ,
291- ungated ! ( macro_escape, Normal , template!( Word ) , WarnFollowing ) , // Deprecated synonym for `macro_use`.
297+ ungated ! (
298+ macro_use, Normal , template!( Word , List : "name1, name2, ..." ) , WarnFollowingWordOnly ,
299+ @only_local: true ,
300+ ) ,
301+ ungated ! ( macro_escape, Normal , template!( Word ) , WarnFollowing , @only_local: true ) , // Deprecated synonym for `macro_use`.
292302 ungated ! ( macro_export, Normal , template!( Word , List : "local_inner_macros" ) , WarnFollowing ) ,
293- ungated ! ( proc_macro, Normal , template!( Word ) , ErrorFollowing ) ,
303+ ungated ! ( proc_macro, Normal , template!( Word ) , ErrorFollowing , @only_local : true ) ,
294304 ungated ! (
295- proc_macro_derive, Normal ,
296- template! ( List : "TraitName, /*opt*/ attributes(name1, name2, ...)" ) , ErrorFollowing ,
305+ proc_macro_derive, Normal , template! ( List : "TraitName, /*opt*/ attributes(name1, name2, ...)" ) ,
306+ ErrorFollowing , @only_local : true ,
297307 ) ,
298- ungated ! ( proc_macro_attribute, Normal , template!( Word ) , ErrorFollowing ) ,
308+ ungated ! ( proc_macro_attribute, Normal , template!( Word ) , ErrorFollowing , @only_local : true ) ,
299309
300310 // Lints:
301311 ungated ! (
@@ -308,7 +318,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
308318 ) ,
309319 gated ! (
310320 expect, Normal , template!( List : r#"lint1, lint2, ..., /*opt*/ reason = "...""# ) , DuplicatesOk ,
311- lint_reasons, experimental!( expect)
321+ @only_local : true , lint_reasons, experimental!( expect)
312322 ) ,
313323 ungated ! (
314324 forbid, Normal , template!( List : r#"lint1, lint2, ..., /*opt*/ reason = "...""# ) ,
@@ -334,32 +344,48 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
334344 ) ,
335345
336346 // Crate properties:
337- ungated ! ( crate_name, CrateLevel , template!( NameValueStr : "name" ) , FutureWarnFollowing ) ,
338- ungated ! ( crate_type, CrateLevel , template!( NameValueStr : "bin|lib|..." ) , DuplicatesOk ) ,
347+ ungated ! (
348+ crate_name, CrateLevel , template!( NameValueStr : "name" ) , FutureWarnFollowing ,
349+ @only_local: true ,
350+ ) ,
351+ ungated ! (
352+ crate_type, CrateLevel , template!( NameValueStr : "bin|lib|..." ) , DuplicatesOk ,
353+ @only_local: true ,
354+ ) ,
339355 // crate_id is deprecated
340- ungated ! ( crate_id, CrateLevel , template!( NameValueStr : "ignored" ) , FutureWarnFollowing ) ,
356+ ungated ! (
357+ crate_id, CrateLevel , template!( NameValueStr : "ignored" ) , FutureWarnFollowing ,
358+ @only_local: true ,
359+ ) ,
341360
342361 // ABI, linking, symbols, and FFI
343362 ungated ! (
344363 link, Normal ,
345364 template!( List : r#"name = "...", /*opt*/ kind = "dylib|static|...", /*opt*/ wasm_import_module = "...", /*opt*/ import_name_type = "decorated|noprefix|undecorated""# ) ,
346365 DuplicatesOk ,
366+ @only_local: true ,
347367 ) ,
348368 ungated ! ( link_name, Normal , template!( NameValueStr : "name" ) , FutureWarnPreceding ) ,
349- ungated ! ( no_link, Normal , template!( Word ) , WarnFollowing ) ,
369+ ungated ! ( no_link, Normal , template!( Word ) , WarnFollowing , @only_local : true ) ,
350370 ungated ! ( repr, Normal , template!( List : "C" ) , DuplicatesOk , @only_local: true ) ,
351- ungated ! ( export_name, Normal , template!( NameValueStr : "name" ) , FutureWarnPreceding ) ,
352- ungated ! ( link_section, Normal , template!( NameValueStr : "name" ) , FutureWarnPreceding ) ,
371+ ungated ! ( export_name, Normal , template!( NameValueStr : "name" ) , FutureWarnPreceding , @only_local : true ) ,
372+ ungated ! ( link_section, Normal , template!( NameValueStr : "name" ) , FutureWarnPreceding , @only_local : true ) ,
353373 ungated ! ( no_mangle, Normal , template!( Word ) , WarnFollowing , @only_local: true ) ,
354374 ungated ! ( used, Normal , template!( Word , List : "compiler|linker" ) , WarnFollowing , @only_local: true ) ,
355375 ungated ! ( link_ordinal, Normal , template!( List : "ordinal" ) , ErrorPreceding ) ,
356376
357377 // Limits:
358- ungated ! ( recursion_limit, CrateLevel , template!( NameValueStr : "N" ) , FutureWarnFollowing ) ,
359- ungated ! ( type_length_limit, CrateLevel , template!( NameValueStr : "N" ) , FutureWarnFollowing ) ,
378+ ungated ! (
379+ recursion_limit, CrateLevel , template!( NameValueStr : "N" ) , FutureWarnFollowing ,
380+ @only_local: true
381+ ) ,
382+ ungated ! (
383+ type_length_limit, CrateLevel , template!( NameValueStr : "N" ) , FutureWarnFollowing ,
384+ @only_local: true
385+ ) ,
360386 gated ! (
361387 move_size_limit, CrateLevel , template!( NameValueStr : "N" ) , ErrorFollowing ,
362- large_assignments, experimental!( move_size_limit)
388+ @only_local : true , large_assignments, experimental!( move_size_limit)
363389 ) ,
364390
365391 // Entry point:
0 commit comments