Skip to content

Commit 11f9489

Browse files
committed
Changing some attributes to only_local.
Modified according to rust-lang/compiler-team#505.
1 parent ef32456 commit 11f9489

File tree

1 file changed

+45
-18
lines changed

1 file changed

+45
-18
lines changed

compiler/rustc_feature/src/builtin_attrs.rs

+45-18
Original file line numberDiff line numberDiff line change
@@ -536,56 +536,80 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
536536
),
537537
gated!(
538538
rustc_allow_const_fn_unstable, Normal,
539-
template!(Word, List: "feat1, feat2, ..."), DuplicatesOk,
539+
template!(Word, List: "feat1, feat2, ..."), DuplicatesOk, @only_local: true,
540540
"rustc_allow_const_fn_unstable side-steps feature gating and stability checks"
541541
),
542542
gated!(
543543
allow_internal_unsafe, Normal, template!(Word), WarnFollowing,
544-
"allow_internal_unsafe side-steps the unsafe_code lint",
544+
@only_local: true, "allow_internal_unsafe side-steps the unsafe_code lint",
545+
),
546+
rustc_attr!(
547+
rustc_allowed_through_unstable_modules, Normal, template!(Word),
548+
WarnFollowing, @only_local: true,
549+
"rustc_allowed_through_unstable_modules special cases accidental stabilizations of stable items \
550+
through unstable paths"
545551
),
546-
rustc_attr!(rustc_allowed_through_unstable_modules, Normal, template!(Word), WarnFollowing,
547-
"rustc_allowed_through_unstable_modules special cases accidental stabilizations of stable items \
548-
through unstable paths"),
549552

550553
// ==========================================================================
551554
// Internal attributes: Type system related:
552555
// ==========================================================================
553556

554557
gated!(fundamental, Normal, template!(Word), WarnFollowing, experimental!(fundamental)),
555558
gated!(
556-
may_dangle, Normal, template!(Word), WarnFollowing, dropck_eyepatch,
559+
may_dangle, Normal, template!(Word), WarnFollowing,
560+
@only_local: true, dropck_eyepatch,
557561
"`may_dangle` has unstable semantics and may be removed in the future",
558562
),
559563

560564
// ==========================================================================
561565
// Internal attributes: Runtime related:
562566
// ==========================================================================
563567

564-
rustc_attr!(rustc_allocator, Normal, template!(Word), WarnFollowing, IMPL_DETAIL),
565-
rustc_attr!(rustc_nounwind, Normal, template!(Word), WarnFollowing, IMPL_DETAIL),
566-
rustc_attr!(rustc_reallocator, Normal, template!(Word), WarnFollowing, IMPL_DETAIL),
567-
rustc_attr!(rustc_deallocator, Normal, template!(Word), WarnFollowing, IMPL_DETAIL),
568-
rustc_attr!(rustc_allocator_zeroed, Normal, template!(Word), WarnFollowing, IMPL_DETAIL),
568+
rustc_attr!(
569+
rustc_allocator, Normal, template!(Word), WarnFollowing,
570+
@only_local: true, IMPL_DETAIL
571+
),
572+
rustc_attr!(
573+
rustc_nounwind, Normal, template!(Word), WarnFollowing,
574+
@only_local: true, IMPL_DETAIL
575+
),
576+
rustc_attr!(
577+
rustc_reallocator, Normal, template!(Word), WarnFollowing,
578+
@only_local: true, IMPL_DETAIL
579+
),
580+
rustc_attr!(
581+
rustc_deallocator, Normal, template!(Word), WarnFollowing,
582+
@only_local: true, IMPL_DETAIL
583+
),
584+
rustc_attr!(
585+
rustc_allocator_zeroed, Normal, template!(Word), WarnFollowing,
586+
@only_local: true, IMPL_DETAIL
587+
),
588+
gated!(
589+
default_lib_allocator, Normal, template!(Word), WarnFollowing,
590+
@only_local: true, allocator_internals, experimental!(default_lib_allocator),
591+
),
569592
gated!(
570-
default_lib_allocator, Normal, template!(Word), WarnFollowing, allocator_internals,
571-
experimental!(default_lib_allocator),
593+
needs_allocator, Normal, template!(Word), WarnFollowing,
594+
@only_local: true, allocator_internals, experimental!(needs_allocator),
572595
),
573596
gated!(
574-
needs_allocator, Normal, template!(Word), WarnFollowing, allocator_internals,
575-
experimental!(needs_allocator),
597+
panic_runtime, Normal, template!(Word), WarnFollowing,
598+
@only_local: true, experimental!(panic_runtime)
576599
),
577-
gated!(panic_runtime, Normal, template!(Word), WarnFollowing, experimental!(panic_runtime)),
578600
gated!(
579601
needs_panic_runtime, Normal, template!(Word), WarnFollowing,
580-
experimental!(needs_panic_runtime)
602+
@only_local: true, experimental!(needs_panic_runtime)
581603
),
582604
gated!(
583605
compiler_builtins, Normal, template!(Word), WarnFollowing,
606+
@only_local: true,
584607
"the `#[compiler_builtins]` attribute is used to identify the `compiler_builtins` crate \
585608
which contains compiler-rt intrinsics and will never be stable",
586609
),
587610
gated!(
588611
profiler_runtime, Normal, template!(Word), WarnFollowing,
612+
@only_local: true,
589613
"the `#[profiler_runtime]` attribute is used to identify the `profiler_builtins` crate \
590614
which contains the profiler runtime and will never be stable",
591615
),
@@ -611,7 +635,10 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
611635
template!(Word, List: "name, /*opt*/ attributes(name1, name2, ...)"), ErrorFollowing,
612636
IMPL_DETAIL,
613637
),
614-
rustc_attr!(rustc_proc_macro_decls, Normal, template!(Word), WarnFollowing, INTERNAL_UNSTABLE),
638+
rustc_attr!(
639+
rustc_proc_macro_decls, Normal, template!(Word), WarnFollowing,
640+
@only_local: true, INTERNAL_UNSTABLE
641+
),
615642
rustc_attr!(
616643
rustc_macro_transparency, Normal,
617644
template!(NameValueStr: "transparent|semitransparent|opaque"), ErrorFollowing,

0 commit comments

Comments
 (0)