Skip to content

Commit e258489

Browse files
committed
stabilize const_int_rotate
1 parent 7e7c337 commit e258489

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

src/libcore/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
#![feature(const_slice_len)]
114114
#![feature(const_str_as_bytes)]
115115
#![feature(const_str_len)]
116-
#![feature(const_int_rotate)]
116+
#![cfg_attr(stage0, feature(const_int_rotate))]
117117
#![feature(const_int_sign)]
118118
#![feature(const_int_conversion)]
119119
#![feature(const_transmute)]

src/libcore/num/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ let m = ", $rot_result, ";
357357
assert_eq!(n.rotate_left(", $rot, "), m);
358358
```"),
359359
#[stable(feature = "rust1", since = "1.0.0")]
360-
#[rustc_const_unstable(feature = "const_int_rotate")]
360+
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_rotate"))]
361361
#[inline]
362362
pub const fn rotate_left(self, n: u32) -> Self {
363363
(self as $UnsignedT).rotate_left(n) as Self
@@ -382,7 +382,7 @@ let m = ", $rot_op, ";
382382
assert_eq!(n.rotate_right(", $rot, "), m);
383383
```"),
384384
#[stable(feature = "rust1", since = "1.0.0")]
385-
#[rustc_const_unstable(feature = "const_int_rotate")]
385+
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_rotate"))]
386386
#[inline]
387387
pub const fn rotate_right(self, n: u32) -> Self {
388388
(self as $UnsignedT).rotate_right(n) as Self
@@ -2310,7 +2310,7 @@ let m = ", $rot_result, ";
23102310
assert_eq!(n.rotate_left(", $rot, "), m);
23112311
```"),
23122312
#[stable(feature = "rust1", since = "1.0.0")]
2313-
#[rustc_const_unstable(feature = "const_int_rotate")]
2313+
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_rotate"))]
23142314
#[inline]
23152315
pub const fn rotate_left(self, n: u32) -> Self {
23162316
unsafe { intrinsics::rotate_left(self, n as $SelfT) }
@@ -2335,7 +2335,7 @@ let m = ", $rot_op, ";
23352335
assert_eq!(n.rotate_right(", $rot, "), m);
23362336
```"),
23372337
#[stable(feature = "rust1", since = "1.0.0")]
2338-
#[rustc_const_unstable(feature = "const_int_rotate")]
2338+
#[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_rotate"))]
23392339
#[inline]
23402340
pub const fn rotate_right(self, n: u32) -> Self {
23412341
unsafe { intrinsics::rotate_right(self, n as $SelfT) }

src/librustc_mir/transform/qualify_min_const_fn.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -396,11 +396,13 @@ fn is_intrinsic_whitelisted(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> bool
396396
| "min_align_of"
397397
| "needs_drop"
398398
// Arithmetic:
399-
| "overflowing_add" // ~> wrapping_add
400-
| "overflowing_sub" // ~> wrapping_sub
401-
| "overflowing_mul" // ~> wrapping_mul
402-
| "unchecked_shl" // ~> wrapping_shl
403-
| "unchecked_shr" // ~> wrapping_shr
399+
| "overflowing_add" // ~> .wrapping_add
400+
| "overflowing_sub" // ~> .wrapping_sub
401+
| "overflowing_mul" // ~> .wrapping_mul
402+
| "unchecked_shl" // ~> .wrapping_shl
403+
| "unchecked_shr" // ~> .wrapping_shr
404+
| "rotate_left" // ~> .rotate_left
405+
| "rotate_right" // ~> .rotate_right
404406
=> true,
405407
_ => false,
406408
}

0 commit comments

Comments
 (0)