Stabilize intrinsics as const

This commit is contained in:
Jacob Pratt 2021-01-14 18:55:37 -05:00
parent 265e03332b
commit f55029ab04
No known key found for this signature in database
GPG key ID: B80E19E4662B5AA4
3 changed files with 2 additions and 6 deletions

View file

@ -1593,7 +1593,7 @@ extern "rust-intrinsic" {
/// Safe wrappers for this intrinsic are available on the integer /// Safe wrappers for this intrinsic are available on the integer
/// primitives via the `checked_div` method. For example, /// primitives via the `checked_div` method. For example,
/// [`u32::checked_div`] /// [`u32::checked_div`]
#[rustc_const_unstable(feature = "const_int_unchecked_arith", issue = "none")] #[rustc_const_stable(feature = "const_int_unchecked_arith", since = "1.51.0")]
pub fn unchecked_div<T: Copy>(x: T, y: T) -> T; pub fn unchecked_div<T: Copy>(x: T, y: T) -> T;
/// Returns the remainder of an unchecked division, resulting in /// Returns the remainder of an unchecked division, resulting in
/// undefined behavior when `y == 0` or `x == T::MIN && y == -1` /// undefined behavior when `y == 0` or `x == T::MIN && y == -1`
@ -1601,7 +1601,7 @@ extern "rust-intrinsic" {
/// Safe wrappers for this intrinsic are available on the integer /// Safe wrappers for this intrinsic are available on the integer
/// primitives via the `checked_rem` method. For example, /// primitives via the `checked_rem` method. For example,
/// [`u32::checked_rem`] /// [`u32::checked_rem`]
#[rustc_const_unstable(feature = "const_int_unchecked_arith", issue = "none")] #[rustc_const_stable(feature = "const_int_unchecked_arith", since = "1.51.0")]
pub fn unchecked_rem<T: Copy>(x: T, y: T) -> T; pub fn unchecked_rem<T: Copy>(x: T, y: T) -> T;
/// Performs an unchecked left shift, resulting in undefined behavior when /// Performs an unchecked left shift, resulting in undefined behavior when

View file

@ -514,7 +514,6 @@ macro_rules! int_impl {
/// ``` /// ```
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "const_checked_int_methods", since = "1.51.0")] #[rustc_const_stable(feature = "const_checked_int_methods", since = "1.51.0")]
#[rustc_allow_const_fn_unstable(const_int_unchecked_arith)]
#[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]
@ -567,7 +566,6 @@ macro_rules! int_impl {
/// ``` /// ```
#[stable(feature = "wrapping", since = "1.7.0")] #[stable(feature = "wrapping", since = "1.7.0")]
#[rustc_const_stable(feature = "const_checked_int_methods", since = "1.51.0")] #[rustc_const_stable(feature = "const_checked_int_methods", since = "1.51.0")]
#[rustc_allow_const_fn_unstable(const_int_unchecked_arith)]
#[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]

View file

@ -523,7 +523,6 @@ macro_rules! uint_impl {
/// ``` /// ```
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "const_checked_int_methods", since = "1.51.0")] #[rustc_const_stable(feature = "const_checked_int_methods", since = "1.51.0")]
#[rustc_allow_const_fn_unstable(const_int_unchecked_arith)]
#[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]
@ -575,7 +574,6 @@ macro_rules! uint_impl {
/// ``` /// ```
#[stable(feature = "wrapping", since = "1.7.0")] #[stable(feature = "wrapping", since = "1.7.0")]
#[rustc_const_stable(feature = "const_checked_int_methods", since = "1.51.0")] #[rustc_const_stable(feature = "const_checked_int_methods", since = "1.51.0")]
#[rustc_allow_const_fn_unstable(const_int_unchecked_arith)]
#[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]