Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a63f6bd

Browse files
committedNov 1, 2024
mark is_val_statically_known intrinsic as stably const-callable
1 parent a8e1186 commit a63f6bd

File tree

4 files changed

+5
-9
lines changed

4 files changed

+5
-9
lines changed
 

‎library/core/src/intrinsics.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -2802,7 +2802,6 @@ where
28022802
/// In other words, the following code has *Undefined Behavior*:
28032803
///
28042804
/// ```no_run
2805-
/// #![feature(is_val_statically_known)]
28062805
/// #![feature(core_intrinsics)]
28072806
/// # #![allow(internal_features)]
28082807
/// use std::hint::unreachable_unchecked;
@@ -2815,7 +2814,6 @@ where
28152814
/// may panic, or it may not:
28162815
///
28172816
/// ```no_run
2818-
/// #![feature(is_val_statically_known)]
28192817
/// #![feature(core_intrinsics)]
28202818
/// # #![allow(internal_features)]
28212819
/// use std::intrinsics::is_val_statically_known;
@@ -2848,7 +2846,6 @@ where
28482846
/// behave identically:
28492847
///
28502848
/// ```
2851-
/// #![feature(is_val_statically_known)]
28522849
/// #![feature(core_intrinsics)]
28532850
/// # #![allow(internal_features)]
28542851
/// use std::intrinsics::is_val_statically_known;
@@ -2865,7 +2862,11 @@ where
28652862
/// # _ = foo(&5_i32);
28662863
/// # _ = bar(&5_i32);
28672864
/// ```
2868-
#[rustc_const_unstable(feature = "is_val_statically_known", issue = "none")]
2865+
#[cfg_attr(
2866+
bootstrap,
2867+
rustc_const_stable(feature = "const_is_val_statically_known", since = "CURRENT_RUSTC_VERSION")
2868+
)]
2869+
#[cfg_attr(not(bootstrap), rustc_const_stable_indirect)]
28692870
#[rustc_nounwind]
28702871
#[unstable(feature = "core_intrinsics", issue = "none")]
28712872
#[rustc_intrinsic]

‎library/core/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@
149149
#![feature(internal_impls_macro)]
150150
#![feature(ip)]
151151
#![feature(is_ascii_octdigit)]
152-
#![feature(is_val_statically_known)]
153152
#![feature(lazy_get)]
154153
#![feature(link_cfg)]
155154
#![feature(non_null_from_ref)]

‎library/core/src/num/int_macros.rs

-2
Original file line numberDiff line numberDiff line change
@@ -2260,7 +2260,6 @@ macro_rules! int_impl {
22602260
#[must_use = "this returns the result of the operation, \
22612261
without modifying the original"]
22622262
#[inline]
2263-
#[rustc_allow_const_fn_unstable(is_val_statically_known)]
22642263
pub const fn wrapping_pow(self, mut exp: u32) -> Self {
22652264
if exp == 0 {
22662265
return 1;
@@ -2828,7 +2827,6 @@ macro_rules! int_impl {
28282827
without modifying the original"]
28292828
#[inline]
28302829
#[rustc_inherit_overflow_checks]
2831-
#[rustc_allow_const_fn_unstable(is_val_statically_known)]
28322830
pub const fn pow(self, mut exp: u32) -> Self {
28332831
if exp == 0 {
28342832
return 1;

‎library/core/src/num/uint_macros.rs

-2
Original file line numberDiff line numberDiff line change
@@ -2190,7 +2190,6 @@ macro_rules! uint_impl {
21902190
#[must_use = "this returns the result of the operation, \
21912191
without modifying the original"]
21922192
#[inline]
2193-
#[rustc_allow_const_fn_unstable(is_val_statically_known)]
21942193
pub const fn wrapping_pow(self, mut exp: u32) -> Self {
21952194
if exp == 0 {
21962195
return 1;
@@ -2706,7 +2705,6 @@ macro_rules! uint_impl {
27062705
without modifying the original"]
27072706
#[inline]
27082707
#[rustc_inherit_overflow_checks]
2709-
#[rustc_allow_const_fn_unstable(is_val_statically_known)]
27102708
pub const fn pow(self, mut exp: u32) -> Self {
27112709
if exp == 0 {
27122710
return 1;

0 commit comments

Comments
 (0)
Failed to load comments.