@@ -555,56 +555,80 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
555
555
) ,
556
556
gated ! (
557
557
rustc_allow_const_fn_unstable, Normal ,
558
- template!( Word , List : "feat1, feat2, ..." ) , DuplicatesOk ,
558
+ template!( Word , List : "feat1, feat2, ..." ) , DuplicatesOk , @only_local : true ,
559
559
"rustc_allow_const_fn_unstable side-steps feature gating and stability checks"
560
560
) ,
561
561
gated ! (
562
562
allow_internal_unsafe, Normal , template!( Word ) , WarnFollowing ,
563
- "allow_internal_unsafe side-steps the unsafe_code lint" ,
563
+ @only_local: true , "allow_internal_unsafe side-steps the unsafe_code lint" ,
564
+ ) ,
565
+ rustc_attr ! (
566
+ rustc_allowed_through_unstable_modules, Normal , template!( Word ) ,
567
+ WarnFollowing , @only_local: true ,
568
+ "rustc_allowed_through_unstable_modules special cases accidental stabilizations of stable items \
569
+ through unstable paths"
564
570
) ,
565
- rustc_attr ! ( rustc_allowed_through_unstable_modules, Normal , template!( Word ) , WarnFollowing ,
566
- "rustc_allowed_through_unstable_modules special cases accidental stabilizations of stable items \
567
- through unstable paths") ,
568
571
569
572
// ==========================================================================
570
573
// Internal attributes: Type system related:
571
574
// ==========================================================================
572
575
573
576
gated ! ( fundamental, Normal , template!( Word ) , WarnFollowing , experimental!( fundamental) ) ,
574
577
gated ! (
575
- may_dangle, Normal , template!( Word ) , WarnFollowing , dropck_eyepatch,
578
+ may_dangle, Normal , template!( Word ) , WarnFollowing ,
579
+ @only_local: true , dropck_eyepatch,
576
580
"`may_dangle` has unstable semantics and may be removed in the future" ,
577
581
) ,
578
582
579
583
// ==========================================================================
580
584
// Internal attributes: Runtime related:
581
585
// ==========================================================================
582
586
583
- rustc_attr ! ( rustc_allocator, Normal , template!( Word ) , WarnFollowing , IMPL_DETAIL ) ,
584
- rustc_attr ! ( rustc_nounwind, Normal , template!( Word ) , WarnFollowing , IMPL_DETAIL ) ,
585
- rustc_attr ! ( rustc_reallocator, Normal , template!( Word ) , WarnFollowing , IMPL_DETAIL ) ,
586
- rustc_attr ! ( rustc_deallocator, Normal , template!( Word ) , WarnFollowing , IMPL_DETAIL ) ,
587
- rustc_attr ! ( rustc_allocator_zeroed, Normal , template!( Word ) , WarnFollowing , IMPL_DETAIL ) ,
587
+ rustc_attr ! (
588
+ rustc_allocator, Normal , template!( Word ) , WarnFollowing ,
589
+ @only_local: true , IMPL_DETAIL
590
+ ) ,
591
+ rustc_attr ! (
592
+ rustc_nounwind, Normal , template!( Word ) , WarnFollowing ,
593
+ @only_local: true , IMPL_DETAIL
594
+ ) ,
595
+ rustc_attr ! (
596
+ rustc_reallocator, Normal , template!( Word ) , WarnFollowing ,
597
+ @only_local: true , IMPL_DETAIL
598
+ ) ,
599
+ rustc_attr ! (
600
+ rustc_deallocator, Normal , template!( Word ) , WarnFollowing ,
601
+ @only_local: true , IMPL_DETAIL
602
+ ) ,
603
+ rustc_attr ! (
604
+ rustc_allocator_zeroed, Normal , template!( Word ) , WarnFollowing ,
605
+ @only_local: true , IMPL_DETAIL
606
+ ) ,
607
+ gated ! (
608
+ default_lib_allocator, Normal , template!( Word ) , WarnFollowing ,
609
+ @only_local: true , allocator_internals, experimental!( default_lib_allocator) ,
610
+ ) ,
588
611
gated ! (
589
- default_lib_allocator , Normal , template!( Word ) , WarnFollowing , allocator_internals ,
590
- experimental!( default_lib_allocator ) ,
612
+ needs_allocator , Normal , template!( Word ) , WarnFollowing ,
613
+ @only_local : true , allocator_internals , experimental!( needs_allocator ) ,
591
614
) ,
592
615
gated ! (
593
- needs_allocator , Normal , template!( Word ) , WarnFollowing , allocator_internals ,
594
- experimental!( needs_allocator ) ,
616
+ panic_runtime , Normal , template!( Word ) , WarnFollowing ,
617
+ @only_local : true , experimental!( panic_runtime )
595
618
) ,
596
- gated ! ( panic_runtime, Normal , template!( Word ) , WarnFollowing , experimental!( panic_runtime) ) ,
597
619
gated ! (
598
620
needs_panic_runtime, Normal , template!( Word ) , WarnFollowing ,
599
- experimental!( needs_panic_runtime)
621
+ @only_local : true , experimental!( needs_panic_runtime)
600
622
) ,
601
623
gated ! (
602
624
compiler_builtins, Normal , template!( Word ) , WarnFollowing ,
625
+ @only_local: true ,
603
626
"the `#[compiler_builtins]` attribute is used to identify the `compiler_builtins` crate \
604
627
which contains compiler-rt intrinsics and will never be stable",
605
628
) ,
606
629
gated ! (
607
630
profiler_runtime, Normal , template!( Word ) , WarnFollowing ,
631
+ @only_local: true ,
608
632
"the `#[profiler_runtime]` attribute is used to identify the `profiler_builtins` crate \
609
633
which contains the profiler runtime and will never be stable",
610
634
) ,
@@ -630,7 +654,10 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
630
654
template!( Word , List : "name, /*opt*/ attributes(name1, name2, ...)" ) , ErrorFollowing ,
631
655
IMPL_DETAIL ,
632
656
) ,
633
- rustc_attr ! ( rustc_proc_macro_decls, Normal , template!( Word ) , WarnFollowing , INTERNAL_UNSTABLE ) ,
657
+ rustc_attr ! (
658
+ rustc_proc_macro_decls, Normal , template!( Word ) , WarnFollowing ,
659
+ @only_local: true , INTERNAL_UNSTABLE
660
+ ) ,
634
661
rustc_attr ! (
635
662
rustc_macro_transparency, Normal ,
636
663
template!( NameValueStr : "transparent|semitransparent|opaque" ) , ErrorFollowing ,
0 commit comments