diff options
| author | Trevor Spiteri <tspiteri@ieee.org> | 2020-06-29 10:36:18 +0200 |
|---|---|---|
| committer | Trevor Spiteri <tspiteri@ieee.org> | 2020-06-29 10:36:18 +0200 |
| commit | c1c674c2dbfe3f6dc47d11368c1b5ee4ab008799 (patch) | |
| tree | e3a9ae977e1bba5d7d4b3a2f8f1bf11d46ceae79 /src | |
| parent | 9739b512a892628534e730ffcd9756b3218c8de8 (diff) | |
| download | rust-c1c674c2dbfe3f6dc47d11368c1b5ee4ab008799.tar.gz rust-c1c674c2dbfe3f6dc47d11368c1b5ee4ab008799.zip | |
stabilize const_saturating_int_methods
Diffstat (limited to 'src')
| -rw-r--r-- | src/libcore/lib.rs | 1 | ||||
| -rw-r--r-- | src/libcore/num/mod.rs | 19 | ||||
| -rw-r--r-- | src/test/ui/consts/const-int-arithmetic.rs | 1 | ||||
| -rw-r--r-- | src/test/ui/consts/const-int-saturating-arith.rs | 1 |
4 files changed, 11 insertions, 11 deletions
diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index aeb52bffbf2..a156edd5160 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -78,7 +78,6 @@ #![feature(const_checked_int_methods)] #![feature(const_euclidean_int_methods)] #![feature(const_overflowing_int_methods)] -#![feature(const_saturating_int_methods)] #![feature(const_int_unchecked_arith)] #![feature(const_int_pow)] #![feature(constctlz)] diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 4647d7421b1..c4d574c5bc5 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -1129,7 +1129,7 @@ $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_const_unstable(feature = "const_saturating_int_methods", issue = "53718")] + #[rustc_const_stable(feature = "const_saturating_int_methods", since = "1.46.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -1155,7 +1155,7 @@ assert_eq!(", stringify!($SelfT), "::MAX.saturating_sub(-1), ", stringify!($Self $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_const_unstable(feature = "const_saturating_int_methods", issue = "53718")] + #[rustc_const_stable(feature = "const_saturating_int_methods", since = "1.46.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -1183,7 +1183,7 @@ $EndFeature, " ```"), #[stable(feature = "saturating_neg", since = "1.45.0")] - #[rustc_const_unstable(feature = "const_saturating_int_methods", issue = "53718")] + #[rustc_const_stable(feature = "const_saturating_int_methods", since = "1.46.0")] #[inline] pub const fn saturating_neg(self) -> Self { intrinsics::saturating_sub(0, self) @@ -1209,7 +1209,8 @@ $EndFeature, " ```"), #[stable(feature = "saturating_neg", since = "1.45.0")] - #[rustc_const_unstable(feature = "const_saturating_int_methods", issue = "53718")] + #[rustc_const_stable(feature = "const_saturating_int_methods", since = "1.46.0")] + #[cfg_attr(bootstrap, allow_internal_unstable(const_if_match))] #[inline] pub const fn saturating_abs(self) -> Self { if self.is_negative() { @@ -1236,9 +1237,10 @@ assert_eq!(", stringify!($SelfT), "::MIN.saturating_mul(10), ", stringify!($Self $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] - #[rustc_const_unstable(feature = "const_saturating_int_methods", issue = "53718")] + #[rustc_const_stable(feature = "const_saturating_int_methods", since = "1.46.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] + #[cfg_attr(bootstrap, allow_internal_unstable(const_if_match))] #[inline] pub const fn saturating_mul(self, rhs: Self) -> Self { match self.checked_mul(rhs) { @@ -3330,7 +3332,7 @@ $EndFeature, " #[stable(feature = "rust1", since = "1.0.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] - #[rustc_const_unstable(feature = "const_saturating_int_methods", issue = "53718")] + #[rustc_const_stable(feature = "const_saturating_int_methods", since = "1.46.0")] #[inline] pub const fn saturating_add(self, rhs: Self) -> Self { intrinsics::saturating_add(self, rhs) @@ -3352,7 +3354,7 @@ assert_eq!(13", stringify!($SelfT), ".saturating_sub(127), 0);", $EndFeature, " #[stable(feature = "rust1", since = "1.0.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] - #[rustc_const_unstable(feature = "const_saturating_int_methods", issue = "53718")] + #[rustc_const_stable(feature = "const_saturating_int_methods", since = "1.46.0")] #[inline] pub const fn saturating_sub(self, rhs: Self) -> Self { intrinsics::saturating_sub(self, rhs) @@ -3374,9 +3376,10 @@ assert_eq!((", stringify!($SelfT), "::MAX).saturating_mul(10), ", stringify!($Se "::MAX);", $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] - #[rustc_const_unstable(feature = "const_saturating_int_methods", issue = "53718")] + #[rustc_const_stable(feature = "const_saturating_int_methods", since = "1.46.0")] #[must_use = "this returns the result of the operation, \ without modifying the original"] + #[cfg_attr(bootstrap, allow_internal_unstable(const_if_match))] #[inline] pub const fn saturating_mul(self, rhs: Self) -> Self { match self.checked_mul(rhs) { diff --git a/src/test/ui/consts/const-int-arithmetic.rs b/src/test/ui/consts/const-int-arithmetic.rs index 9c94551f744..9b2e30961aa 100644 --- a/src/test/ui/consts/const-int-arithmetic.rs +++ b/src/test/ui/consts/const-int-arithmetic.rs @@ -3,7 +3,6 @@ #![feature(const_checked_int_methods)] #![feature(const_euclidean_int_methods)] #![feature(const_overflowing_int_methods)] -#![feature(const_saturating_int_methods)] #![feature(const_wrapping_int_methods)] use std::{i8, i128}; diff --git a/src/test/ui/consts/const-int-saturating-arith.rs b/src/test/ui/consts/const-int-saturating-arith.rs index 4718120a51b..7edbdd4cec5 100644 --- a/src/test/ui/consts/const-int-saturating-arith.rs +++ b/src/test/ui/consts/const-int-saturating-arith.rs @@ -1,5 +1,4 @@ // run-pass -#![feature(const_saturating_int_methods)] const INT_U32_NO: u32 = (42 as u32).saturating_add(2); const INT_U32: u32 = u32::MAX.saturating_add(1); |
