mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-10 11:06:49 +00:00
mark is_val_statically_known intrinsic as stably const-callable
This commit is contained in:
parent
78bb5ee79e
commit
7651fc6edc
@ -3016,7 +3016,6 @@ pub(crate) macro const_eval_select {
|
|||||||
/// In other words, the following code has *Undefined Behavior*:
|
/// In other words, the following code has *Undefined Behavior*:
|
||||||
///
|
///
|
||||||
/// ```no_run
|
/// ```no_run
|
||||||
/// #![feature(is_val_statically_known)]
|
|
||||||
/// #![feature(core_intrinsics)]
|
/// #![feature(core_intrinsics)]
|
||||||
/// # #![allow(internal_features)]
|
/// # #![allow(internal_features)]
|
||||||
/// use std::hint::unreachable_unchecked;
|
/// use std::hint::unreachable_unchecked;
|
||||||
@ -3029,7 +3028,6 @@ pub(crate) macro const_eval_select {
|
|||||||
/// may panic, or it may not:
|
/// may panic, or it may not:
|
||||||
///
|
///
|
||||||
/// ```no_run
|
/// ```no_run
|
||||||
/// #![feature(is_val_statically_known)]
|
|
||||||
/// #![feature(core_intrinsics)]
|
/// #![feature(core_intrinsics)]
|
||||||
/// # #![allow(internal_features)]
|
/// # #![allow(internal_features)]
|
||||||
/// use std::intrinsics::is_val_statically_known;
|
/// use std::intrinsics::is_val_statically_known;
|
||||||
@ -3062,7 +3060,6 @@ pub(crate) macro const_eval_select {
|
|||||||
/// behave identically:
|
/// behave identically:
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// #![feature(is_val_statically_known)]
|
|
||||||
/// #![feature(core_intrinsics)]
|
/// #![feature(core_intrinsics)]
|
||||||
/// # #![allow(internal_features)]
|
/// # #![allow(internal_features)]
|
||||||
/// use std::intrinsics::is_val_statically_known;
|
/// use std::intrinsics::is_val_statically_known;
|
||||||
@ -3079,7 +3076,11 @@ pub(crate) macro const_eval_select {
|
|||||||
/// # _ = foo(&5_i32);
|
/// # _ = foo(&5_i32);
|
||||||
/// # _ = bar(&5_i32);
|
/// # _ = bar(&5_i32);
|
||||||
/// ```
|
/// ```
|
||||||
#[rustc_const_unstable(feature = "is_val_statically_known", issue = "none")]
|
#[cfg_attr(
|
||||||
|
bootstrap,
|
||||||
|
rustc_const_stable(feature = "const_is_val_statically_known", since = "CURRENT_RUSTC_VERSION")
|
||||||
|
)]
|
||||||
|
#[cfg_attr(not(bootstrap), rustc_const_stable_indirect)]
|
||||||
#[rustc_nounwind]
|
#[rustc_nounwind]
|
||||||
#[unstable(feature = "core_intrinsics", issue = "none")]
|
#[unstable(feature = "core_intrinsics", issue = "none")]
|
||||||
#[rustc_intrinsic]
|
#[rustc_intrinsic]
|
||||||
|
@ -141,7 +141,6 @@
|
|||||||
#![feature(internal_impls_macro)]
|
#![feature(internal_impls_macro)]
|
||||||
#![feature(ip)]
|
#![feature(ip)]
|
||||||
#![feature(is_ascii_octdigit)]
|
#![feature(is_ascii_octdigit)]
|
||||||
#![feature(is_val_statically_known)]
|
|
||||||
#![feature(lazy_get)]
|
#![feature(lazy_get)]
|
||||||
#![feature(link_cfg)]
|
#![feature(link_cfg)]
|
||||||
#![feature(non_null_from_ref)]
|
#![feature(non_null_from_ref)]
|
||||||
|
@ -2242,7 +2242,6 @@ macro_rules! int_impl {
|
|||||||
#[must_use = "this returns the result of the operation, \
|
#[must_use = "this returns the result of the operation, \
|
||||||
without modifying the original"]
|
without modifying the original"]
|
||||||
#[inline]
|
#[inline]
|
||||||
#[rustc_allow_const_fn_unstable(is_val_statically_known)]
|
|
||||||
pub const fn wrapping_pow(self, mut exp: u32) -> Self {
|
pub const fn wrapping_pow(self, mut exp: u32) -> Self {
|
||||||
if exp == 0 {
|
if exp == 0 {
|
||||||
return 1;
|
return 1;
|
||||||
@ -2808,7 +2807,6 @@ macro_rules! int_impl {
|
|||||||
without modifying the original"]
|
without modifying the original"]
|
||||||
#[inline]
|
#[inline]
|
||||||
#[rustc_inherit_overflow_checks]
|
#[rustc_inherit_overflow_checks]
|
||||||
#[rustc_allow_const_fn_unstable(is_val_statically_known)]
|
|
||||||
pub const fn pow(self, mut exp: u32) -> Self {
|
pub const fn pow(self, mut exp: u32) -> Self {
|
||||||
if exp == 0 {
|
if exp == 0 {
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -2174,7 +2174,6 @@ macro_rules! uint_impl {
|
|||||||
#[must_use = "this returns the result of the operation, \
|
#[must_use = "this returns the result of the operation, \
|
||||||
without modifying the original"]
|
without modifying the original"]
|
||||||
#[inline]
|
#[inline]
|
||||||
#[rustc_allow_const_fn_unstable(is_val_statically_known)]
|
|
||||||
pub const fn wrapping_pow(self, mut exp: u32) -> Self {
|
pub const fn wrapping_pow(self, mut exp: u32) -> Self {
|
||||||
if exp == 0 {
|
if exp == 0 {
|
||||||
return 1;
|
return 1;
|
||||||
@ -2688,7 +2687,6 @@ macro_rules! uint_impl {
|
|||||||
without modifying the original"]
|
without modifying the original"]
|
||||||
#[inline]
|
#[inline]
|
||||||
#[rustc_inherit_overflow_checks]
|
#[rustc_inherit_overflow_checks]
|
||||||
#[rustc_allow_const_fn_unstable(is_val_statically_known)]
|
|
||||||
pub const fn pow(self, mut exp: u32) -> Self {
|
pub const fn pow(self, mut exp: u32) -> Self {
|
||||||
if exp == 0 {
|
if exp == 0 {
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
|
|
||||||
#![feature(core_intrinsics, is_val_statically_known)]
|
#![feature(core_intrinsics)]
|
||||||
|
|
||||||
use std::intrinsics::is_val_statically_known;
|
use std::intrinsics::is_val_statically_known;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user