Skip to content

Commit c1c674c

Browse files
committed
stabilize const_saturating_int_methods
1 parent 9739b51 commit c1c674c

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

src/libcore/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@
7878
#![feature(const_checked_int_methods)]
7979
#![feature(const_euclidean_int_methods)]
8080
#![feature(const_overflowing_int_methods)]
81-
#![feature(const_saturating_int_methods)]
8281
#![feature(const_int_unchecked_arith)]
8382
#![feature(const_int_pow)]
8483
#![feature(constctlz)]

src/libcore/num/mod.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,7 @@ $EndFeature, "
11291129
```"),
11301130

11311131
#[stable(feature = "rust1", since = "1.0.0")]
1132-
#[rustc_const_unstable(feature = "const_saturating_int_methods", issue = "53718")]
1132+
#[rustc_const_stable(feature = "const_saturating_int_methods", since = "1.46.0")]
11331133
#[must_use = "this returns the result of the operation, \
11341134
without modifying the original"]
11351135
#[inline]
@@ -1155,7 +1155,7 @@ assert_eq!(", stringify!($SelfT), "::MAX.saturating_sub(-1), ", stringify!($Self
11551155
$EndFeature, "
11561156
```"),
11571157
#[stable(feature = "rust1", since = "1.0.0")]
1158-
#[rustc_const_unstable(feature = "const_saturating_int_methods", issue = "53718")]
1158+
#[rustc_const_stable(feature = "const_saturating_int_methods", since = "1.46.0")]
11591159
#[must_use = "this returns the result of the operation, \
11601160
without modifying the original"]
11611161
#[inline]
@@ -1183,7 +1183,7 @@ $EndFeature, "
11831183
```"),
11841184

11851185
#[stable(feature = "saturating_neg", since = "1.45.0")]
1186-
#[rustc_const_unstable(feature = "const_saturating_int_methods", issue = "53718")]
1186+
#[rustc_const_stable(feature = "const_saturating_int_methods", since = "1.46.0")]
11871187
#[inline]
11881188
pub const fn saturating_neg(self) -> Self {
11891189
intrinsics::saturating_sub(0, self)
@@ -1209,7 +1209,8 @@ $EndFeature, "
12091209
```"),
12101210

12111211
#[stable(feature = "saturating_neg", since = "1.45.0")]
1212-
#[rustc_const_unstable(feature = "const_saturating_int_methods", issue = "53718")]
1212+
#[rustc_const_stable(feature = "const_saturating_int_methods", since = "1.46.0")]
1213+
#[cfg_attr(bootstrap, allow_internal_unstable(const_if_match))]
12131214
#[inline]
12141215
pub const fn saturating_abs(self) -> Self {
12151216
if self.is_negative() {
@@ -1236,9 +1237,10 @@ assert_eq!(", stringify!($SelfT), "::MIN.saturating_mul(10), ", stringify!($Self
12361237
$EndFeature, "
12371238
```"),
12381239
#[stable(feature = "wrapping", since = "1.7.0")]
1239-
#[rustc_const_unstable(feature = "const_saturating_int_methods", issue = "53718")]
1240+
#[rustc_const_stable(feature = "const_saturating_int_methods", since = "1.46.0")]
12401241
#[must_use = "this returns the result of the operation, \
12411242
without modifying the original"]
1243+
#[cfg_attr(bootstrap, allow_internal_unstable(const_if_match))]
12421244
#[inline]
12431245
pub const fn saturating_mul(self, rhs: Self) -> Self {
12441246
match self.checked_mul(rhs) {
@@ -3330,7 +3332,7 @@ $EndFeature, "
33303332
#[stable(feature = "rust1", since = "1.0.0")]
33313333
#[must_use = "this returns the result of the operation, \
33323334
without modifying the original"]
3333-
#[rustc_const_unstable(feature = "const_saturating_int_methods", issue = "53718")]
3335+
#[rustc_const_stable(feature = "const_saturating_int_methods", since = "1.46.0")]
33343336
#[inline]
33353337
pub const fn saturating_add(self, rhs: Self) -> Self {
33363338
intrinsics::saturating_add(self, rhs)
@@ -3352,7 +3354,7 @@ assert_eq!(13", stringify!($SelfT), ".saturating_sub(127), 0);", $EndFeature, "
33523354
#[stable(feature = "rust1", since = "1.0.0")]
33533355
#[must_use = "this returns the result of the operation, \
33543356
without modifying the original"]
3355-
#[rustc_const_unstable(feature = "const_saturating_int_methods", issue = "53718")]
3357+
#[rustc_const_stable(feature = "const_saturating_int_methods", since = "1.46.0")]
33563358
#[inline]
33573359
pub const fn saturating_sub(self, rhs: Self) -> Self {
33583360
intrinsics::saturating_sub(self, rhs)
@@ -3374,9 +3376,10 @@ assert_eq!((", stringify!($SelfT), "::MAX).saturating_mul(10), ", stringify!($Se
33743376
"::MAX);", $EndFeature, "
33753377
```"),
33763378
#[stable(feature = "wrapping", since = "1.7.0")]
3377-
#[rustc_const_unstable(feature = "const_saturating_int_methods", issue = "53718")]
3379+
#[rustc_const_stable(feature = "const_saturating_int_methods", since = "1.46.0")]
33783380
#[must_use = "this returns the result of the operation, \
33793381
without modifying the original"]
3382+
#[cfg_attr(bootstrap, allow_internal_unstable(const_if_match))]
33803383
#[inline]
33813384
pub const fn saturating_mul(self, rhs: Self) -> Self {
33823385
match self.checked_mul(rhs) {

src/test/ui/consts/const-int-arithmetic.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#![feature(const_checked_int_methods)]
44
#![feature(const_euclidean_int_methods)]
55
#![feature(const_overflowing_int_methods)]
6-
#![feature(const_saturating_int_methods)]
76
#![feature(const_wrapping_int_methods)]
87

98
use std::{i8, i128};

src/test/ui/consts/const-int-saturating-arith.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// run-pass
2-
#![feature(const_saturating_int_methods)]
32

43
const INT_U32_NO: u32 = (42 as u32).saturating_add(2);
54
const INT_U32: u32 = u32::MAX.saturating_add(1);

0 commit comments

Comments
 (0)