Skip to content

Commit bf0c2d5

Browse files
authored
Rollup merge of rust-lang#81904 - jhpratt:const_int_fn-stabilization, r=jyn514
Bump stabilization version for const int methods These methods missed the beta cutoff. See rust-lang#80962 for details. `@rustbot` modify labels to +A-const-fn, +A-intrinsics r? `@m-ou-se`
2 parents e2765f8 + 1b32a7a commit bf0c2d5

File tree

3 files changed

+30
-30
lines changed

3 files changed

+30
-30
lines changed

library/core/src/intrinsics.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1586,15 +1586,15 @@ extern "rust-intrinsic" {
15861586
/// Safe wrappers for this intrinsic are available on the integer
15871587
/// primitives via the `checked_div` method. For example,
15881588
/// [`u32::checked_div`]
1589-
#[rustc_const_stable(feature = "const_int_unchecked_arith", since = "1.51.0")]
1589+
#[rustc_const_stable(feature = "const_int_unchecked_arith", since = "1.52.0")]
15901590
pub fn unchecked_div<T: Copy>(x: T, y: T) -> T;
15911591
/// Returns the remainder of an unchecked division, resulting in
15921592
/// undefined behavior when `y == 0` or `x == T::MIN && y == -1`
15931593
///
15941594
/// Safe wrappers for this intrinsic are available on the integer
15951595
/// primitives via the `checked_rem` method. For example,
15961596
/// [`u32::checked_rem`]
1597-
#[rustc_const_stable(feature = "const_int_unchecked_arith", since = "1.51.0")]
1597+
#[rustc_const_stable(feature = "const_int_unchecked_arith", since = "1.52.0")]
15981598
pub fn unchecked_rem<T: Copy>(x: T, y: T) -> T;
15991599

16001600
/// Performs an unchecked left shift, resulting in undefined behavior when

library/core/src/num/int_macros.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ macro_rules! int_impl {
513513
#[doc = concat!("assert_eq!((1", stringify!($SelfT), ").checked_div(0), None);")]
514514
/// ```
515515
#[stable(feature = "rust1", since = "1.0.0")]
516-
#[rustc_const_stable(feature = "const_checked_int_methods", since = "1.51.0")]
516+
#[rustc_const_stable(feature = "const_checked_int_methods", since = "1.52.0")]
517517
#[must_use = "this returns the result of the operation, \
518518
without modifying the original"]
519519
#[inline]
@@ -539,7 +539,7 @@ macro_rules! int_impl {
539539
#[doc = concat!("assert_eq!((1", stringify!($SelfT), ").checked_div_euclid(0), None);")]
540540
/// ```
541541
#[stable(feature = "euclidean_division", since = "1.38.0")]
542-
#[rustc_const_stable(feature = "const_euclidean_int_methods", since = "1.51.0")]
542+
#[rustc_const_stable(feature = "const_euclidean_int_methods", since = "1.52.0")]
543543
#[must_use = "this returns the result of the operation, \
544544
without modifying the original"]
545545
#[inline]
@@ -565,7 +565,7 @@ macro_rules! int_impl {
565565
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.checked_rem(-1), None);")]
566566
/// ```
567567
#[stable(feature = "wrapping", since = "1.7.0")]
568-
#[rustc_const_stable(feature = "const_checked_int_methods", since = "1.51.0")]
568+
#[rustc_const_stable(feature = "const_checked_int_methods", since = "1.52.0")]
569569
#[must_use = "this returns the result of the operation, \
570570
without modifying the original"]
571571
#[inline]
@@ -591,7 +591,7 @@ macro_rules! int_impl {
591591
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.checked_rem_euclid(-1), None);")]
592592
/// ```
593593
#[stable(feature = "euclidean_division", since = "1.38.0")]
594-
#[rustc_const_stable(feature = "const_euclidean_int_methods", since = "1.51.0")]
594+
#[rustc_const_stable(feature = "const_euclidean_int_methods", since = "1.52.0")]
595595
#[must_use = "this returns the result of the operation, \
596596
without modifying the original"]
597597
#[inline]
@@ -949,7 +949,7 @@ macro_rules! int_impl {
949949
/// assert_eq!((-128i8).wrapping_div(-1), -128);
950950
/// ```
951951
#[stable(feature = "num_wrapping", since = "1.2.0")]
952-
#[rustc_const_stable(feature = "const_wrapping_int_methods", since = "1.51.0")]
952+
#[rustc_const_stable(feature = "const_wrapping_int_methods", since = "1.52.0")]
953953
#[must_use = "this returns the result of the operation, \
954954
without modifying the original"]
955955
#[inline]
@@ -977,7 +977,7 @@ macro_rules! int_impl {
977977
/// assert_eq!((-128i8).wrapping_div_euclid(-1), -128);
978978
/// ```
979979
#[stable(feature = "euclidean_division", since = "1.38.0")]
980-
#[rustc_const_stable(feature = "const_euclidean_int_methods", since = "1.51.0")]
980+
#[rustc_const_stable(feature = "const_euclidean_int_methods", since = "1.52.0")]
981981
#[must_use = "this returns the result of the operation, \
982982
without modifying the original"]
983983
#[inline]
@@ -1005,7 +1005,7 @@ macro_rules! int_impl {
10051005
/// assert_eq!((-128i8).wrapping_rem(-1), 0);
10061006
/// ```
10071007
#[stable(feature = "num_wrapping", since = "1.2.0")]
1008-
#[rustc_const_stable(feature = "const_wrapping_int_methods", since = "1.51.0")]
1008+
#[rustc_const_stable(feature = "const_wrapping_int_methods", since = "1.52.0")]
10091009
#[must_use = "this returns the result of the operation, \
10101010
without modifying the original"]
10111011
#[inline]
@@ -1032,7 +1032,7 @@ macro_rules! int_impl {
10321032
/// assert_eq!((-128i8).wrapping_rem_euclid(-1), 0);
10331033
/// ```
10341034
#[stable(feature = "euclidean_division", since = "1.38.0")]
1035-
#[rustc_const_stable(feature = "const_euclidean_int_methods", since = "1.51.0")]
1035+
#[rustc_const_stable(feature = "const_euclidean_int_methods", since = "1.52.0")]
10361036
#[must_use = "this returns the result of the operation, \
10371037
without modifying the original"]
10381038
#[inline]
@@ -1299,7 +1299,7 @@ macro_rules! int_impl {
12991299
/// ```
13001300
#[inline]
13011301
#[stable(feature = "wrapping", since = "1.7.0")]
1302-
#[rustc_const_stable(feature = "const_overflowing_int_methods", since = "1.51.0")]
1302+
#[rustc_const_stable(feature = "const_overflowing_int_methods", since = "1.52.0")]
13031303
#[must_use = "this returns the result of the operation, \
13041304
without modifying the original"]
13051305
pub const fn overflowing_div(self, rhs: Self) -> (Self, bool) {
@@ -1329,7 +1329,7 @@ macro_rules! int_impl {
13291329
/// ```
13301330
#[inline]
13311331
#[stable(feature = "euclidean_division", since = "1.38.0")]
1332-
#[rustc_const_stable(feature = "const_euclidean_int_methods", since = "1.51.0")]
1332+
#[rustc_const_stable(feature = "const_euclidean_int_methods", since = "1.52.0")]
13331333
#[must_use = "this returns the result of the operation, \
13341334
without modifying the original"]
13351335
pub const fn overflowing_div_euclid(self, rhs: Self) -> (Self, bool) {
@@ -1360,7 +1360,7 @@ macro_rules! int_impl {
13601360
/// ```
13611361
#[inline]
13621362
#[stable(feature = "wrapping", since = "1.7.0")]
1363-
#[rustc_const_stable(feature = "const_overflowing_int_methods", since = "1.51.0")]
1363+
#[rustc_const_stable(feature = "const_overflowing_int_methods", since = "1.52.0")]
13641364
#[must_use = "this returns the result of the operation, \
13651365
without modifying the original"]
13661366
pub const fn overflowing_rem(self, rhs: Self) -> (Self, bool) {
@@ -1390,7 +1390,7 @@ macro_rules! int_impl {
13901390
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.overflowing_rem_euclid(-1), (0, true));")]
13911391
/// ```
13921392
#[stable(feature = "euclidean_division", since = "1.38.0")]
1393-
#[rustc_const_stable(feature = "const_euclidean_int_methods", since = "1.51.0")]
1393+
#[rustc_const_stable(feature = "const_euclidean_int_methods", since = "1.52.0")]
13941394
#[must_use = "this returns the result of the operation, \
13951395
without modifying the original"]
13961396
#[inline]
@@ -1615,7 +1615,7 @@ macro_rules! int_impl {
16151615
/// assert_eq!((-a).div_euclid(-b), 2); // -7 >= -4 * 2
16161616
/// ```
16171617
#[stable(feature = "euclidean_division", since = "1.38.0")]
1618-
#[rustc_const_stable(feature = "const_euclidean_int_methods", since = "1.51.0")]
1618+
#[rustc_const_stable(feature = "const_euclidean_int_methods", since = "1.52.0")]
16191619
#[must_use = "this returns the result of the operation, \
16201620
without modifying the original"]
16211621
#[inline]
@@ -1653,7 +1653,7 @@ macro_rules! int_impl {
16531653
/// assert_eq!((-a).rem_euclid(-b), 1);
16541654
/// ```
16551655
#[stable(feature = "euclidean_division", since = "1.38.0")]
1656-
#[rustc_const_stable(feature = "const_euclidean_int_methods", since = "1.51.0")]
1656+
#[rustc_const_stable(feature = "const_euclidean_int_methods", since = "1.52.0")]
16571657
#[must_use = "this returns the result of the operation, \
16581658
without modifying the original"]
16591659
#[inline]

library/core/src/num/uint_macros.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ macro_rules! uint_impl {
522522
#[doc = concat!("assert_eq!(1", stringify!($SelfT), ".checked_div(0), None);")]
523523
/// ```
524524
#[stable(feature = "rust1", since = "1.0.0")]
525-
#[rustc_const_stable(feature = "const_checked_int_methods", since = "1.51.0")]
525+
#[rustc_const_stable(feature = "const_checked_int_methods", since = "1.52.0")]
526526
#[must_use = "this returns the result of the operation, \
527527
without modifying the original"]
528528
#[inline]
@@ -548,7 +548,7 @@ macro_rules! uint_impl {
548548
#[doc = concat!("assert_eq!(1", stringify!($SelfT), ".checked_div_euclid(0), None);")]
549549
/// ```
550550
#[stable(feature = "euclidean_division", since = "1.38.0")]
551-
#[rustc_const_stable(feature = "const_euclidean_int_methods", since = "1.51.0")]
551+
#[rustc_const_stable(feature = "const_euclidean_int_methods", since = "1.52.0")]
552552
#[must_use = "this returns the result of the operation, \
553553
without modifying the original"]
554554
#[inline]
@@ -573,7 +573,7 @@ macro_rules! uint_impl {
573573
#[doc = concat!("assert_eq!(5", stringify!($SelfT), ".checked_rem(0), None);")]
574574
/// ```
575575
#[stable(feature = "wrapping", since = "1.7.0")]
576-
#[rustc_const_stable(feature = "const_checked_int_methods", since = "1.51.0")]
576+
#[rustc_const_stable(feature = "const_checked_int_methods", since = "1.52.0")]
577577
#[must_use = "this returns the result of the operation, \
578578
without modifying the original"]
579579
#[inline]
@@ -599,7 +599,7 @@ macro_rules! uint_impl {
599599
#[doc = concat!("assert_eq!(5", stringify!($SelfT), ".checked_rem_euclid(0), None);")]
600600
/// ```
601601
#[stable(feature = "euclidean_division", since = "1.38.0")]
602-
#[rustc_const_stable(feature = "const_euclidean_int_methods", since = "1.51.0")]
602+
#[rustc_const_stable(feature = "const_euclidean_int_methods", since = "1.52.0")]
603603
#[must_use = "this returns the result of the operation, \
604604
without modifying the original"]
605605
#[inline]
@@ -876,7 +876,7 @@ macro_rules! uint_impl {
876876
#[doc = concat!("assert_eq!(100", stringify!($SelfT), ".wrapping_div(10), 10);")]
877877
/// ```
878878
#[stable(feature = "num_wrapping", since = "1.2.0")]
879-
#[rustc_const_stable(feature = "const_wrapping_int_methods", since = "1.51.0")]
879+
#[rustc_const_stable(feature = "const_wrapping_int_methods", since = "1.52.0")]
880880
#[must_use = "this returns the result of the operation, \
881881
without modifying the original"]
882882
#[inline]
@@ -901,7 +901,7 @@ macro_rules! uint_impl {
901901
#[doc = concat!("assert_eq!(100", stringify!($SelfT), ".wrapping_div_euclid(10), 10);")]
902902
/// ```
903903
#[stable(feature = "euclidean_division", since = "1.38.0")]
904-
#[rustc_const_stable(feature = "const_euclidean_int_methods", since = "1.51.0")]
904+
#[rustc_const_stable(feature = "const_euclidean_int_methods", since = "1.52.0")]
905905
#[must_use = "this returns the result of the operation, \
906906
without modifying the original"]
907907
#[inline]
@@ -924,7 +924,7 @@ macro_rules! uint_impl {
924924
#[doc = concat!("assert_eq!(100", stringify!($SelfT), ".wrapping_rem(10), 0);")]
925925
/// ```
926926
#[stable(feature = "num_wrapping", since = "1.2.0")]
927-
#[rustc_const_stable(feature = "const_wrapping_int_methods", since = "1.51.0")]
927+
#[rustc_const_stable(feature = "const_wrapping_int_methods", since = "1.52.0")]
928928
#[must_use = "this returns the result of the operation, \
929929
without modifying the original"]
930930
#[inline]
@@ -950,7 +950,7 @@ macro_rules! uint_impl {
950950
#[doc = concat!("assert_eq!(100", stringify!($SelfT), ".wrapping_rem_euclid(10), 0);")]
951951
/// ```
952952
#[stable(feature = "euclidean_division", since = "1.38.0")]
953-
#[rustc_const_stable(feature = "const_euclidean_int_methods", since = "1.51.0")]
953+
#[rustc_const_stable(feature = "const_euclidean_int_methods", since = "1.52.0")]
954954
#[must_use = "this returns the result of the operation, \
955955
without modifying the original"]
956956
#[inline]
@@ -1185,7 +1185,7 @@ macro_rules! uint_impl {
11851185
/// ```
11861186
#[inline]
11871187
#[stable(feature = "wrapping", since = "1.7.0")]
1188-
#[rustc_const_stable(feature = "const_overflowing_int_methods", since = "1.51.0")]
1188+
#[rustc_const_stable(feature = "const_overflowing_int_methods", since = "1.52.0")]
11891189
#[must_use = "this returns the result of the operation, \
11901190
without modifying the original"]
11911191
pub const fn overflowing_div(self, rhs: Self) -> (Self, bool) {
@@ -1215,7 +1215,7 @@ macro_rules! uint_impl {
12151215
/// ```
12161216
#[inline]
12171217
#[stable(feature = "euclidean_division", since = "1.38.0")]
1218-
#[rustc_const_stable(feature = "const_euclidean_int_methods", since = "1.51.0")]
1218+
#[rustc_const_stable(feature = "const_euclidean_int_methods", since = "1.52.0")]
12191219
#[must_use = "this returns the result of the operation, \
12201220
without modifying the original"]
12211221
pub const fn overflowing_div_euclid(self, rhs: Self) -> (Self, bool) {
@@ -1242,7 +1242,7 @@ macro_rules! uint_impl {
12421242
/// ```
12431243
#[inline]
12441244
#[stable(feature = "wrapping", since = "1.7.0")]
1245-
#[rustc_const_stable(feature = "const_overflowing_int_methods", since = "1.51.0")]
1245+
#[rustc_const_stable(feature = "const_overflowing_int_methods", since = "1.52.0")]
12461246
#[must_use = "this returns the result of the operation, \
12471247
without modifying the original"]
12481248
pub const fn overflowing_rem(self, rhs: Self) -> (Self, bool) {
@@ -1272,7 +1272,7 @@ macro_rules! uint_impl {
12721272
/// ```
12731273
#[inline]
12741274
#[stable(feature = "euclidean_division", since = "1.38.0")]
1275-
#[rustc_const_stable(feature = "const_euclidean_int_methods", since = "1.51.0")]
1275+
#[rustc_const_stable(feature = "const_euclidean_int_methods", since = "1.52.0")]
12761276
#[must_use = "this returns the result of the operation, \
12771277
without modifying the original"]
12781278
pub const fn overflowing_rem_euclid(self, rhs: Self) -> (Self, bool) {
@@ -1456,7 +1456,7 @@ macro_rules! uint_impl {
14561456
#[doc = concat!("assert_eq!(7", stringify!($SelfT), ".div_euclid(4), 1); // or any other integer type")]
14571457
/// ```
14581458
#[stable(feature = "euclidean_division", since = "1.38.0")]
1459-
#[rustc_const_stable(feature = "const_euclidean_int_methods", since = "1.51.0")]
1459+
#[rustc_const_stable(feature = "const_euclidean_int_methods", since = "1.52.0")]
14601460
#[must_use = "this returns the result of the operation, \
14611461
without modifying the original"]
14621462
#[inline]
@@ -1484,7 +1484,7 @@ macro_rules! uint_impl {
14841484
#[doc = concat!("assert_eq!(7", stringify!($SelfT), ".rem_euclid(4), 3); // or any other integer type")]
14851485
/// ```
14861486
#[stable(feature = "euclidean_division", since = "1.38.0")]
1487-
#[rustc_const_stable(feature = "const_euclidean_int_methods", since = "1.51.0")]
1487+
#[rustc_const_stable(feature = "const_euclidean_int_methods", since = "1.52.0")]
14881488
#[must_use = "this returns the result of the operation, \
14891489
without modifying the original"]
14901490
#[inline]

0 commit comments

Comments
 (0)