@@ -709,7 +709,9 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
709
709
// Internal attributes, Const related:
710
710
// ==========================================================================
711
711
712
- rustc_attr ! ( rustc_promotable, Normal , template!( Word ) , WarnFollowing , IMPL_DETAIL ) ,
712
+ rustc_attr ! (
713
+ rustc_promotable, Normal , template!( Word ) , WarnFollowing ,
714
+ @only_local: true , IMPL_DETAIL ) ,
713
715
rustc_attr ! (
714
716
rustc_legacy_const_generics, Normal , template!( List : "N" ) , ErrorFollowing ,
715
717
INTERNAL_UNSTABLE
@@ -720,7 +722,8 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
720
722
) ,
721
723
// Ensure the argument to this function is &&str during const-check.
722
724
rustc_attr ! (
723
- rustc_const_panic_str, Normal , template!( Word ) , WarnFollowing , INTERNAL_UNSTABLE
725
+ rustc_const_panic_str, Normal , template!( Word ) ,
726
+ WarnFollowing , INTERNAL_UNSTABLE
724
727
) ,
725
728
726
729
// ==========================================================================
@@ -784,7 +787,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
784
787
the given type by annotating all impl items with #[rustc_allow_incoherent_impl]."
785
788
) ,
786
789
rustc_attr ! (
787
- rustc_box, AttributeType :: Normal , template!( Word ) , ErrorFollowing ,
790
+ rustc_box, AttributeType :: Normal , template!( Word ) , ErrorFollowing , @only_local : true ,
788
791
"#[rustc_box] allows creating boxes \
789
792
and it is only intended to be used in `alloc`."
790
793
) ,
@@ -806,11 +809,11 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
806
809
gated ! (
807
810
// Used in resolve:
808
811
prelude_import, Normal , template!( Word ) , WarnFollowing ,
809
- "`#[prelude_import]` is for use by rustc only" ,
812
+ @only_local : true , "`#[prelude_import]` is for use by rustc only" ,
810
813
) ,
811
814
gated ! (
812
- rustc_paren_sugar, Normal , template!( Word ) , WarnFollowing , unboxed_closures ,
813
- "unboxed_closures are still evolving" ,
815
+ rustc_paren_sugar, Normal , template!( Word ) , WarnFollowing , @only_local : true ,
816
+ unboxed_closures , "unboxed_closures are still evolving" ,
814
817
) ,
815
818
rustc_attr ! (
816
819
rustc_inherit_overflow_checks, Normal , template!( Word ) , WarnFollowing , @only_local: true ,
@@ -826,27 +829,31 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
826
829
) ,
827
830
rustc_attr ! (
828
831
rustc_test_marker, Normal , template!( NameValueStr : "name" ) , WarnFollowing ,
829
- "the `#[rustc_test_marker]` attribute is used internally to track tests" ,
832
+ @only_local : true , "the `#[rustc_test_marker]` attribute is used internally to track tests" ,
830
833
) ,
831
834
rustc_attr ! (
832
- rustc_unsafe_specialization_marker, Normal , template!( Word ) , WarnFollowing ,
835
+ rustc_unsafe_specialization_marker, Normal , template!( Word ) ,
836
+ WarnFollowing , @only_local: true ,
833
837
"the `#[rustc_unsafe_specialization_marker]` attribute is used to check specializations"
834
838
) ,
835
839
rustc_attr ! (
836
- rustc_specialization_trait, Normal , template!( Word ) , WarnFollowing ,
840
+ rustc_specialization_trait, Normal , template!( Word ) ,
841
+ WarnFollowing , @only_local: true ,
837
842
"the `#[rustc_specialization_trait]` attribute is used to check specializations"
838
843
) ,
839
844
rustc_attr ! (
840
- rustc_main, Normal , template!( Word ) , WarnFollowing ,
845
+ rustc_main, Normal , template!( Word ) , WarnFollowing , @only_local : true ,
841
846
"the `#[rustc_main]` attribute is used internally to specify test entry point function" ,
842
847
) ,
843
848
rustc_attr ! (
844
- rustc_skip_array_during_method_dispatch, Normal , template!( Word ) , WarnFollowing ,
849
+ rustc_skip_array_during_method_dispatch, Normal , template!( Word ) ,
850
+ WarnFollowing , @only_local: true ,
845
851
"the `#[rustc_skip_array_during_method_dispatch]` attribute is used to exclude a trait \
846
852
from method dispatch when the receiver is an array, for compatibility in editions < 2021."
847
853
) ,
848
854
rustc_attr ! (
849
- rustc_must_implement_one_of, Normal , template!( List : "function1, function2, ..." ) , ErrorFollowing ,
855
+ rustc_must_implement_one_of, Normal , template!( List : "function1, function2, ..." ) ,
856
+ ErrorFollowing , @only_local: true ,
850
857
"the `#[rustc_must_implement_one_of]` attribute is used to change minimal complete \
851
858
definition of a trait, it's currently in experimental form and should be changed before \
852
859
being exposed outside of the std"
@@ -857,6 +864,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
857
864
) ,
858
865
rustc_attr ! (
859
866
rustc_safe_intrinsic, Normal , template!( Word ) , WarnFollowing ,
867
+ @only_local: true ,
860
868
"the `#[rustc_safe_intrinsic]` attribute is used internally to mark intrinsics as safe"
861
869
) ,
862
870
rustc_attr ! (
@@ -873,8 +881,14 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
873
881
// ==========================================================================
874
882
875
883
rustc_attr ! ( TEST , rustc_effective_visibility, Normal , template!( Word ) , WarnFollowing ) ,
876
- rustc_attr ! ( TEST , rustc_outlives, Normal , template!( Word ) , WarnFollowing ) ,
877
- rustc_attr ! ( TEST , rustc_capture_analysis, Normal , template!( Word ) , WarnFollowing ) ,
884
+ rustc_attr ! (
885
+ TEST , rustc_outlives, Normal , template!( Word ) ,
886
+ WarnFollowing , @only_local: true
887
+ ) ,
888
+ rustc_attr ! (
889
+ TEST , rustc_capture_analysis, Normal , template!( Word ) ,
890
+ WarnFollowing , @only_local: true
891
+ ) ,
878
892
rustc_attr ! ( TEST , rustc_insignificant_dtor, Normal , template!( Word ) , WarnFollowing ) ,
879
893
rustc_attr ! ( TEST , rustc_strict_coherence, Normal , template!( Word ) , WarnFollowing ) ,
880
894
rustc_attr ! ( TEST , rustc_variance, Normal , template!( Word ) , WarnFollowing ) ,
0 commit comments