Skip to content

Commit 72a8d53

Browse files
authored
Rollup merge of rust-lang#133142 - RalfJung:naming-is-hard, r=compiler-errors
rename rustc_const_stable_intrinsic -> rustc_intrinsic_const_stable_indirect In rust-lang#120370 this name caused confusion as the author thought the intrinsic was stable. So let's try a different name... If we can land this before the beta cutoff we can avoid needing `cfg(bootstrap)` for this. ;) Cc `@compiler-errors` `@saethlin`
2 parents 21654a2 + 9d4b1b2 commit 72a8d53

File tree

7 files changed

+54
-54
lines changed

7 files changed

+54
-54
lines changed

compiler/rustc_const_eval/messages.ftl

+1-1
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ const_eval_uninhabited_enum_variant_written =
403403
const_eval_unmarked_const_fn_exposed = `{$def_path}` cannot be (indirectly) exposed to stable
404404
.help = either mark the callee as `#[rustc_const_stable_indirect]`, or the caller as `#[rustc_const_unstable]`
405405
const_eval_unmarked_intrinsic_exposed = intrinsic `{$def_path}` cannot be (indirectly) exposed to stable
406-
.help = mark the caller as `#[rustc_const_unstable]`, or mark the intrinsic `#[rustc_const_stable_intrinsic]` (but this requires team approval)
406+
.help = mark the caller as `#[rustc_const_unstable]`, or mark the intrinsic `#[rustc_intrinsic_const_stable_indirect]` (but this requires team approval)
407407
408408
const_eval_unreachable = entering unreachable code
409409
const_eval_unreachable_unwind =

compiler/rustc_const_eval/src/check_consts/check.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
760760
Some(ConstStability { level: StabilityLevel::Stable { .. }, .. }) => {
761761
// All good. Note that a `#[rustc_const_stable]` intrinsic (meaning it
762762
// can be *directly* invoked from stable const code) does not always
763-
// have the `#[rustc_const_stable_intrinsic]` attribute (which controls
763+
// have the `#[rustc_intrinsic_const_stable_indirect]` attribute (which controls
764764
// exposing an intrinsic indirectly); we accept this call anyway.
765765
}
766766
}

compiler/rustc_feature/src/builtin_attrs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
838838
template!(Word), WarnFollowing, EncodeCrossCrate::No, IMPL_DETAIL,
839839
),
840840
rustc_attr!(
841-
rustc_const_stable_intrinsic, Normal,
841+
rustc_intrinsic_const_stable_indirect, Normal,
842842
template!(Word), WarnFollowing, EncodeCrossCrate::No, IMPL_DETAIL,
843843
),
844844
gated!(

compiler/rustc_middle/src/ty/util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1793,7 +1793,7 @@ pub fn intrinsic_raw(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Option<ty::Intrinsi
17931793
Some(ty::IntrinsicDef {
17941794
name: tcx.item_name(def_id.into()),
17951795
must_be_overridden: tcx.has_attr(def_id, sym::rustc_intrinsic_must_be_overridden),
1796-
const_stable: tcx.has_attr(def_id, sym::rustc_const_stable_intrinsic),
1796+
const_stable: tcx.has_attr(def_id, sym::rustc_intrinsic_const_stable_indirect),
17971797
})
17981798
} else {
17991799
None

compiler/rustc_span/src/symbol.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1666,7 +1666,6 @@ symbols! {
16661666
rustc_const_panic_str,
16671667
rustc_const_stable,
16681668
rustc_const_stable_indirect,
1669-
rustc_const_stable_intrinsic,
16701669
rustc_const_unstable,
16711670
rustc_conversion_suggestion,
16721671
rustc_deallocator,
@@ -1696,6 +1695,7 @@ symbols! {
16961695
rustc_inherit_overflow_checks,
16971696
rustc_insignificant_dtor,
16981697
rustc_intrinsic,
1698+
rustc_intrinsic_const_stable_indirect,
16991699
rustc_intrinsic_must_be_overridden,
17001700
rustc_layout,
17011701
rustc_layout_scalar_valid_range_end,

library/core/src/intrinsics/mod.rs

+48-48
Large diffs are not rendered by default.

tests/ui/consts/const-unstable-intrinsic.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ error: intrinsic `copy::copy` cannot be (indirectly) exposed to stable
7474
LL | unsafe { copy(src, dst, count) }
7575
| ^^^^^^^^^^^^^^^^^^^^^
7676
|
77-
= help: mark the caller as `#[rustc_const_unstable]`, or mark the intrinsic `#[rustc_const_stable_intrinsic]` (but this requires team approval)
77+
= help: mark the caller as `#[rustc_const_unstable]`, or mark the intrinsic `#[rustc_intrinsic_const_stable_indirect]` (but this requires team approval)
7878

7979
error: const function that might be (indirectly) exposed to stable cannot use `#[feature(local)]`
8080
--> $DIR/const-unstable-intrinsic.rs:61:9

0 commit comments

Comments
 (0)