@@ -536,56 +536,80 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
536
536
) ,
537
537
gated ! (
538
538
rustc_allow_const_fn_unstable, Normal ,
539
- template!( Word , List : "feat1, feat2, ..." ) , DuplicatesOk ,
539
+ template!( Word , List : "feat1, feat2, ..." ) , DuplicatesOk , @only_local : true ,
540
540
"rustc_allow_const_fn_unstable side-steps feature gating and stability checks"
541
541
) ,
542
542
gated ! (
543
543
allow_internal_unsafe, Normal , template!( Word ) , WarnFollowing ,
544
- "allow_internal_unsafe side-steps the unsafe_code lint" ,
544
+ @only_local: true , "allow_internal_unsafe side-steps the unsafe_code lint" ,
545
+ ) ,
546
+ rustc_attr ! (
547
+ rustc_allowed_through_unstable_modules, Normal , template!( Word ) ,
548
+ WarnFollowing , @only_local: true ,
549
+ "rustc_allowed_through_unstable_modules special cases accidental stabilizations of stable items \
550
+ through unstable paths"
545
551
) ,
546
- rustc_attr ! ( rustc_allowed_through_unstable_modules, Normal , template!( Word ) , WarnFollowing ,
547
- "rustc_allowed_through_unstable_modules special cases accidental stabilizations of stable items \
548
- through unstable paths") ,
549
552
550
553
// ==========================================================================
551
554
// Internal attributes: Type system related:
552
555
// ==========================================================================
553
556
554
557
gated ! ( fundamental, Normal , template!( Word ) , WarnFollowing , experimental!( fundamental) ) ,
555
558
gated ! (
556
- may_dangle, Normal , template!( Word ) , WarnFollowing , dropck_eyepatch,
559
+ may_dangle, Normal , template!( Word ) , WarnFollowing ,
560
+ @only_local: true , dropck_eyepatch,
557
561
"`may_dangle` has unstable semantics and may be removed in the future" ,
558
562
) ,
559
563
560
564
// ==========================================================================
561
565
// Internal attributes: Runtime related:
562
566
// ==========================================================================
563
567
564
- rustc_attr ! ( rustc_allocator, Normal , template!( Word ) , WarnFollowing , IMPL_DETAIL ) ,
565
- rustc_attr ! ( rustc_nounwind, Normal , template!( Word ) , WarnFollowing , IMPL_DETAIL ) ,
566
- rustc_attr ! ( rustc_reallocator, Normal , template!( Word ) , WarnFollowing , IMPL_DETAIL ) ,
567
- rustc_attr ! ( rustc_deallocator, Normal , template!( Word ) , WarnFollowing , IMPL_DETAIL ) ,
568
- rustc_attr ! ( rustc_allocator_zeroed, Normal , template!( Word ) , WarnFollowing , IMPL_DETAIL ) ,
568
+ rustc_attr ! (
569
+ rustc_allocator, Normal , template!( Word ) , WarnFollowing ,
570
+ @only_local: true , IMPL_DETAIL
571
+ ) ,
572
+ rustc_attr ! (
573
+ rustc_nounwind, Normal , template!( Word ) , WarnFollowing ,
574
+ @only_local: true , IMPL_DETAIL
575
+ ) ,
576
+ rustc_attr ! (
577
+ rustc_reallocator, Normal , template!( Word ) , WarnFollowing ,
578
+ @only_local: true , IMPL_DETAIL
579
+ ) ,
580
+ rustc_attr ! (
581
+ rustc_deallocator, Normal , template!( Word ) , WarnFollowing ,
582
+ @only_local: true , IMPL_DETAIL
583
+ ) ,
584
+ rustc_attr ! (
585
+ rustc_allocator_zeroed, Normal , template!( Word ) , WarnFollowing ,
586
+ @only_local: true , IMPL_DETAIL
587
+ ) ,
588
+ gated ! (
589
+ default_lib_allocator, Normal , template!( Word ) , WarnFollowing ,
590
+ @only_local: true , allocator_internals, experimental!( default_lib_allocator) ,
591
+ ) ,
569
592
gated ! (
570
- default_lib_allocator , Normal , template!( Word ) , WarnFollowing , allocator_internals ,
571
- experimental!( default_lib_allocator ) ,
593
+ needs_allocator , Normal , template!( Word ) , WarnFollowing ,
594
+ @only_local : true , allocator_internals , experimental!( needs_allocator ) ,
572
595
) ,
573
596
gated ! (
574
- needs_allocator , Normal , template!( Word ) , WarnFollowing , allocator_internals ,
575
- experimental!( needs_allocator ) ,
597
+ panic_runtime , Normal , template!( Word ) , WarnFollowing ,
598
+ @only_local : true , experimental!( panic_runtime )
576
599
) ,
577
- gated ! ( panic_runtime, Normal , template!( Word ) , WarnFollowing , experimental!( panic_runtime) ) ,
578
600
gated ! (
579
601
needs_panic_runtime, Normal , template!( Word ) , WarnFollowing ,
580
- experimental!( needs_panic_runtime)
602
+ @only_local : true , experimental!( needs_panic_runtime)
581
603
) ,
582
604
gated ! (
583
605
compiler_builtins, Normal , template!( Word ) , WarnFollowing ,
606
+ @only_local: true ,
584
607
"the `#[compiler_builtins]` attribute is used to identify the `compiler_builtins` crate \
585
608
which contains compiler-rt intrinsics and will never be stable",
586
609
) ,
587
610
gated ! (
588
611
profiler_runtime, Normal , template!( Word ) , WarnFollowing ,
612
+ @only_local: true ,
589
613
"the `#[profiler_runtime]` attribute is used to identify the `profiler_builtins` crate \
590
614
which contains the profiler runtime and will never be stable",
591
615
) ,
@@ -611,7 +635,10 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
611
635
template!( Word , List : "name, /*opt*/ attributes(name1, name2, ...)" ) , ErrorFollowing ,
612
636
IMPL_DETAIL ,
613
637
) ,
614
- rustc_attr ! ( rustc_proc_macro_decls, Normal , template!( Word ) , WarnFollowing , INTERNAL_UNSTABLE ) ,
638
+ rustc_attr ! (
639
+ rustc_proc_macro_decls, Normal , template!( Word ) , WarnFollowing ,
640
+ @only_local: true , INTERNAL_UNSTABLE
641
+ ) ,
615
642
rustc_attr ! (
616
643
rustc_macro_transparency, Normal ,
617
644
template!( NameValueStr : "transparent|semitransparent|opaque" ) , ErrorFollowing ,
0 commit comments