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