@@ -700,16 +700,24 @@ 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
@@ -720,7 +728,8 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
720
728
) ,
721
729
// Ensure the argument to this function is &&str during const-check.
722
730
rustc_attr ! (
723
- rustc_const_panic_str, Normal , template!( Word ) , WarnFollowing , INTERNAL_UNSTABLE
731
+ rustc_const_panic_str, Normal , template!( Word ) ,
732
+ WarnFollowing , INTERNAL_UNSTABLE
724
733
) ,
725
734
726
735
// ==========================================================================
@@ -784,7 +793,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
784
793
the given type by annotating all impl items with #[rustc_allow_incoherent_impl]."
785
794
) ,
786
795
rustc_attr ! (
787
- rustc_box, AttributeType :: Normal , template!( Word ) , ErrorFollowing ,
796
+ rustc_box, AttributeType :: Normal , template!( Word ) , ErrorFollowing , @only_local : true ,
788
797
"#[rustc_box] allows creating boxes \
789
798
and it is only intended to be used in `alloc`."
790
799
) ,
@@ -806,11 +815,11 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
806
815
gated ! (
807
816
// Used in resolve:
808
817
prelude_import, Normal , template!( Word ) , WarnFollowing ,
809
- "`#[prelude_import]` is for use by rustc only" ,
818
+ @only_local : true , "`#[prelude_import]` is for use by rustc only" ,
810
819
) ,
811
820
gated ! (
812
- rustc_paren_sugar, Normal , template!( Word ) , WarnFollowing , unboxed_closures ,
813
- "unboxed_closures are still evolving" ,
821
+ rustc_paren_sugar, Normal , template!( Word ) , WarnFollowing , @only_local : true ,
822
+ unboxed_closures , "unboxed_closures are still evolving" ,
814
823
) ,
815
824
rustc_attr ! (
816
825
rustc_inherit_overflow_checks, Normal , template!( Word ) , WarnFollowing , @only_local: true ,
@@ -826,37 +835,43 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
826
835
) ,
827
836
rustc_attr ! (
828
837
rustc_test_marker, Normal , template!( NameValueStr : "name" ) , WarnFollowing ,
829
- "the `#[rustc_test_marker]` attribute is used internally to track tests" ,
838
+ @only_local : true , "the `#[rustc_test_marker]` attribute is used internally to track tests" ,
830
839
) ,
831
840
rustc_attr ! (
832
- rustc_unsafe_specialization_marker, Normal , template!( Word ) , WarnFollowing ,
841
+ rustc_unsafe_specialization_marker, Normal , template!( Word ) ,
842
+ WarnFollowing , @only_local: true ,
833
843
"the `#[rustc_unsafe_specialization_marker]` attribute is used to check specializations"
834
844
) ,
835
845
rustc_attr ! (
836
- rustc_specialization_trait, Normal , template!( Word ) , WarnFollowing ,
846
+ rustc_specialization_trait, Normal , template!( Word ) ,
847
+ WarnFollowing , @only_local: true ,
837
848
"the `#[rustc_specialization_trait]` attribute is used to check specializations"
838
849
) ,
839
850
rustc_attr ! (
840
- rustc_main, Normal , template!( Word ) , WarnFollowing ,
851
+ rustc_main, Normal , template!( Word ) , WarnFollowing , @only_local : true ,
841
852
"the `#[rustc_main]` attribute is used internally to specify test entry point function" ,
842
853
) ,
843
854
rustc_attr ! (
844
- rustc_skip_array_during_method_dispatch, Normal , template!( Word ) , WarnFollowing ,
855
+ rustc_skip_array_during_method_dispatch, Normal , template!( Word ) ,
856
+ WarnFollowing , @only_local: true ,
845
857
"the `#[rustc_skip_array_during_method_dispatch]` attribute is used to exclude a trait \
846
858
from method dispatch when the receiver is an array, for compatibility in editions < 2021."
847
859
) ,
848
860
rustc_attr ! (
849
- rustc_must_implement_one_of, Normal , template!( List : "function1, function2, ..." ) , ErrorFollowing ,
861
+ rustc_must_implement_one_of, Normal , template!( List : "function1, function2, ..." ) ,
862
+ ErrorFollowing , @only_local: true ,
850
863
"the `#[rustc_must_implement_one_of]` attribute is used to change minimal complete \
851
864
definition of a trait, it's currently in experimental form and should be changed before \
852
865
being exposed outside of the std"
853
866
) ,
854
867
rustc_attr ! (
855
- rustc_doc_primitive, Normal , template!( NameValueStr : "primitive name" ) , ErrorFollowing ,
868
+ rustc_doc_primitive, Normal , template!( NameValueStr : "primitive name" ) ,
869
+ ErrorFollowing , @only_local: true ,
856
870
r#"`rustc_doc_primitive` is a rustc internal attribute"# ,
857
871
) ,
858
872
rustc_attr ! (
859
873
rustc_safe_intrinsic, Normal , template!( Word ) , WarnFollowing ,
874
+ @only_local: true ,
860
875
"the `#[rustc_safe_intrinsic]` attribute is used internally to mark intrinsics as safe"
861
876
) ,
862
877
rustc_attr ! (
0 commit comments