@@ -700,27 +700,37 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
700
700
rustc_attr ! ( rustc_lint_diagnostics, Normal , template!( Word ) , WarnFollowing , INTERNAL_UNSTABLE ) ,
701
701
// Used by the `rustc::bad_opt_access` lint to identify `DebuggingOptions` and `CodegenOptions`
702
702
// types (as well as any others in future).
703
- rustc_attr ! ( rustc_lint_opt_ty, Normal , template!( Word ) , WarnFollowing , INTERNAL_UNSTABLE ) ,
703
+ rustc_attr ! (
704
+ rustc_lint_opt_ty, Normal , template!( Word ) ,
705
+ WarnFollowing , @only_local: true , INTERNAL_UNSTABLE
706
+ ) ,
704
707
// Used by the `rustc::bad_opt_access` lint on fields
705
708
// types (as well as any others in future).
706
- rustc_attr ! ( rustc_lint_opt_deny_field_access, Normal , template!( List : "message" ) , WarnFollowing , INTERNAL_UNSTABLE ) ,
709
+ rustc_attr ! (
710
+ rustc_lint_opt_deny_field_access, Normal , template!( List : "message" ) ,
711
+ WarnFollowing , @only_local: true , INTERNAL_UNSTABLE
712
+ ) ,
707
713
708
714
// ==========================================================================
709
715
// Internal attributes, Const related:
710
716
// ==========================================================================
711
717
712
- rustc_attr ! ( rustc_promotable, Normal , template!( Word ) , WarnFollowing , IMPL_DETAIL ) ,
718
+ rustc_attr ! (
719
+ rustc_promotable, Normal , template!( Word ) , WarnFollowing ,
720
+ @only_local: true , IMPL_DETAIL ) ,
713
721
rustc_attr ! (
714
722
rustc_legacy_const_generics, Normal , template!( List : "N" ) , ErrorFollowing ,
715
723
INTERNAL_UNSTABLE
716
724
) ,
717
725
// Do not const-check this function's body. It will always get replaced during CTFE.
718
726
rustc_attr ! (
719
- rustc_do_not_const_check, Normal , template!( Word ) , WarnFollowing , INTERNAL_UNSTABLE
727
+ rustc_do_not_const_check, Normal , template!( Word ) ,
728
+ WarnFollowing , @only_local: true , INTERNAL_UNSTABLE
720
729
) ,
721
730
// Ensure the argument to this function is &&str during const-check.
722
731
rustc_attr ! (
723
- rustc_const_panic_str, Normal , template!( Word ) , WarnFollowing , INTERNAL_UNSTABLE
732
+ rustc_const_panic_str, Normal , template!( Word ) ,
733
+ WarnFollowing , INTERNAL_UNSTABLE
724
734
) ,
725
735
726
736
// ==========================================================================
@@ -784,7 +794,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
784
794
the given type by annotating all impl items with #[rustc_allow_incoherent_impl]."
785
795
) ,
786
796
rustc_attr ! (
787
- rustc_box, AttributeType :: Normal , template!( Word ) , ErrorFollowing ,
797
+ rustc_box, AttributeType :: Normal , template!( Word ) , ErrorFollowing , @only_local : true ,
788
798
"#[rustc_box] allows creating boxes \
789
799
and it is only intended to be used in `alloc`."
790
800
) ,
@@ -806,11 +816,11 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
806
816
gated ! (
807
817
// Used in resolve:
808
818
prelude_import, Normal , template!( Word ) , WarnFollowing ,
809
- "`#[prelude_import]` is for use by rustc only" ,
819
+ @only_local : true , "`#[prelude_import]` is for use by rustc only" ,
810
820
) ,
811
821
gated ! (
812
- rustc_paren_sugar, Normal , template!( Word ) , WarnFollowing , unboxed_closures ,
813
- "unboxed_closures are still evolving" ,
822
+ rustc_paren_sugar, Normal , template!( Word ) , WarnFollowing , @only_local : true ,
823
+ unboxed_closures , "unboxed_closures are still evolving" ,
814
824
) ,
815
825
rustc_attr ! (
816
826
rustc_inherit_overflow_checks, Normal , template!( Word ) , WarnFollowing , @only_local: true ,
@@ -826,37 +836,43 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
826
836
) ,
827
837
rustc_attr ! (
828
838
rustc_test_marker, Normal , template!( NameValueStr : "name" ) , WarnFollowing ,
829
- "the `#[rustc_test_marker]` attribute is used internally to track tests" ,
839
+ @only_local : true , "the `#[rustc_test_marker]` attribute is used internally to track tests" ,
830
840
) ,
831
841
rustc_attr ! (
832
- rustc_unsafe_specialization_marker, Normal , template!( Word ) , WarnFollowing ,
842
+ rustc_unsafe_specialization_marker, Normal , template!( Word ) ,
843
+ WarnFollowing , @only_local: true ,
833
844
"the `#[rustc_unsafe_specialization_marker]` attribute is used to check specializations"
834
845
) ,
835
846
rustc_attr ! (
836
- rustc_specialization_trait, Normal , template!( Word ) , WarnFollowing ,
847
+ rustc_specialization_trait, Normal , template!( Word ) ,
848
+ WarnFollowing , @only_local: true ,
837
849
"the `#[rustc_specialization_trait]` attribute is used to check specializations"
838
850
) ,
839
851
rustc_attr ! (
840
- rustc_main, Normal , template!( Word ) , WarnFollowing ,
852
+ rustc_main, Normal , template!( Word ) , WarnFollowing , @only_local : true ,
841
853
"the `#[rustc_main]` attribute is used internally to specify test entry point function" ,
842
854
) ,
843
855
rustc_attr ! (
844
- rustc_skip_array_during_method_dispatch, Normal , template!( Word ) , WarnFollowing ,
856
+ rustc_skip_array_during_method_dispatch, Normal , template!( Word ) ,
857
+ WarnFollowing , @only_local: true ,
845
858
"the `#[rustc_skip_array_during_method_dispatch]` attribute is used to exclude a trait \
846
859
from method dispatch when the receiver is an array, for compatibility in editions < 2021."
847
860
) ,
848
861
rustc_attr ! (
849
- rustc_must_implement_one_of, Normal , template!( List : "function1, function2, ..." ) , ErrorFollowing ,
862
+ rustc_must_implement_one_of, Normal , template!( List : "function1, function2, ..." ) ,
863
+ ErrorFollowing , @only_local: true ,
850
864
"the `#[rustc_must_implement_one_of]` attribute is used to change minimal complete \
851
865
definition of a trait, it's currently in experimental form and should be changed before \
852
866
being exposed outside of the std"
853
867
) ,
854
868
rustc_attr ! (
855
- rustc_doc_primitive, Normal , template!( NameValueStr : "primitive name" ) , ErrorFollowing ,
869
+ rustc_doc_primitive, Normal , template!( NameValueStr : "primitive name" ) ,
870
+ ErrorFollowing , @only_local: true ,
856
871
r#"`rustc_doc_primitive` is a rustc internal attribute"# ,
857
872
) ,
858
873
rustc_attr ! (
859
874
rustc_safe_intrinsic, Normal , template!( Word ) , WarnFollowing ,
875
+ @only_local: true ,
860
876
"the `#[rustc_safe_intrinsic]` attribute is used internally to mark intrinsics as safe"
861
877
) ,
862
878
rustc_attr ! (
0 commit comments