Skip to content

Commit 86c6651

Browse files
authored
Unrolled build for rust-lang#122014
Rollup merge of rust-lang#122014 - surechen:change_attributes_to_local_20240304, r=lcnr Change some attributes to only_local. Modified according to rust-lang/compiler-team#505. r? ``@lcnr``
2 parents 62415e2 + 8dd126d commit 86c6651

File tree

1 file changed

+26
-13
lines changed

1 file changed

+26
-13
lines changed

compiler/rustc_feature/src/builtin_attrs.rs

+26-13
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,9 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
709709
// Internal attributes, Const related:
710710
// ==========================================================================
711711

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),
713715
rustc_attr!(
714716
rustc_legacy_const_generics, Normal, template!(List: "N"), ErrorFollowing,
715717
INTERNAL_UNSTABLE
@@ -784,7 +786,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
784786
the given type by annotating all impl items with #[rustc_allow_incoherent_impl]."
785787
),
786788
rustc_attr!(
787-
rustc_box, AttributeType::Normal, template!(Word), ErrorFollowing,
789+
rustc_box, AttributeType::Normal, template!(Word), ErrorFollowing, @only_local: true,
788790
"#[rustc_box] allows creating boxes \
789791
and it is only intended to be used in `alloc`."
790792
),
@@ -806,11 +808,11 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
806808
gated!(
807809
// Used in resolve:
808810
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",
810812
),
811813
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",
814816
),
815817
rustc_attr!(
816818
rustc_inherit_overflow_checks, Normal, template!(Word), WarnFollowing, @only_local: true,
@@ -826,27 +828,31 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
826828
),
827829
rustc_attr!(
828830
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",
830832
),
831833
rustc_attr!(
832-
rustc_unsafe_specialization_marker, Normal, template!(Word), WarnFollowing,
834+
rustc_unsafe_specialization_marker, Normal, template!(Word),
835+
WarnFollowing, @only_local: true,
833836
"the `#[rustc_unsafe_specialization_marker]` attribute is used to check specializations"
834837
),
835838
rustc_attr!(
836-
rustc_specialization_trait, Normal, template!(Word), WarnFollowing,
839+
rustc_specialization_trait, Normal, template!(Word),
840+
WarnFollowing, @only_local: true,
837841
"the `#[rustc_specialization_trait]` attribute is used to check specializations"
838842
),
839843
rustc_attr!(
840-
rustc_main, Normal, template!(Word), WarnFollowing,
844+
rustc_main, Normal, template!(Word), WarnFollowing, @only_local: true,
841845
"the `#[rustc_main]` attribute is used internally to specify test entry point function",
842846
),
843847
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,
845850
"the `#[rustc_skip_array_during_method_dispatch]` attribute is used to exclude a trait \
846851
from method dispatch when the receiver is an array, for compatibility in editions < 2021."
847852
),
848853
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,
850856
"the `#[rustc_must_implement_one_of]` attribute is used to change minimal complete \
851857
definition of a trait, it's currently in experimental form and should be changed before \
852858
being exposed outside of the std"
@@ -857,6 +863,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
857863
),
858864
rustc_attr!(
859865
rustc_safe_intrinsic, Normal, template!(Word), WarnFollowing,
866+
@only_local: true,
860867
"the `#[rustc_safe_intrinsic]` attribute is used internally to mark intrinsics as safe"
861868
),
862869
rustc_attr!(
@@ -877,8 +884,14 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
877884
// ==========================================================================
878885

879886
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+
),
882895
rustc_attr!(TEST, rustc_insignificant_dtor, Normal, template!(Word), WarnFollowing),
883896
rustc_attr!(TEST, rustc_strict_coherence, Normal, template!(Word), WarnFollowing),
884897
rustc_attr!(TEST, rustc_variance, Normal, template!(Word), WarnFollowing),

0 commit comments

Comments
 (0)