diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2018-12-24 19:24:48 +0100 |
|---|---|---|
| committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2018-12-31 03:36:46 +0100 |
| commit | e258489eae1d5e0b8a624e1729fb64fbcb6e29ee (patch) | |
| tree | e946ded6678df1a2acd1f8de0a368864771416ae /src | |
| parent | 7e7c337aef6e87f6152771351eaed32b31d666f7 (diff) | |
| download | rust-e258489eae1d5e0b8a624e1729fb64fbcb6e29ee.tar.gz rust-e258489eae1d5e0b8a624e1729fb64fbcb6e29ee.zip | |
stabilize const_int_rotate
Diffstat (limited to 'src')
| -rw-r--r-- | src/libcore/lib.rs | 2 | ||||
| -rw-r--r-- | src/libcore/num/mod.rs | 8 | ||||
| -rw-r--r-- | src/librustc_mir/transform/qualify_min_const_fn.rs | 12 |
3 files changed, 12 insertions, 10 deletions
diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index a613c1afd09..dc4a5fbed7c 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -113,7 +113,7 @@ #![feature(const_slice_len)] #![feature(const_str_as_bytes)] #![feature(const_str_len)] -#![feature(const_int_rotate)] +#![cfg_attr(stage0, feature(const_int_rotate))] #![feature(const_int_sign)] #![feature(const_int_conversion)] #![feature(const_transmute)] diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 58ea651aa83..6f32451299b 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -357,7 +357,7 @@ let m = ", $rot_result, "; assert_eq!(n.rotate_left(", $rot, "), m); ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_const_unstable(feature = "const_int_rotate")] + #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_rotate"))] #[inline] pub const fn rotate_left(self, n: u32) -> Self { (self as $UnsignedT).rotate_left(n) as Self @@ -382,7 +382,7 @@ let m = ", $rot_op, "; assert_eq!(n.rotate_right(", $rot, "), m); ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_const_unstable(feature = "const_int_rotate")] + #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_rotate"))] #[inline] pub const fn rotate_right(self, n: u32) -> Self { (self as $UnsignedT).rotate_right(n) as Self @@ -2310,7 +2310,7 @@ let m = ", $rot_result, "; assert_eq!(n.rotate_left(", $rot, "), m); ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_const_unstable(feature = "const_int_rotate")] + #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_rotate"))] #[inline] pub const fn rotate_left(self, n: u32) -> Self { unsafe { intrinsics::rotate_left(self, n as $SelfT) } @@ -2335,7 +2335,7 @@ let m = ", $rot_op, "; assert_eq!(n.rotate_right(", $rot, "), m); ```"), #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_const_unstable(feature = "const_int_rotate")] + #[cfg_attr(stage0, rustc_const_unstable(feature = "const_int_rotate"))] #[inline] pub const fn rotate_right(self, n: u32) -> Self { unsafe { intrinsics::rotate_right(self, n as $SelfT) } diff --git a/src/librustc_mir/transform/qualify_min_const_fn.rs b/src/librustc_mir/transform/qualify_min_const_fn.rs index f271fbaa55b..43013129541 100644 --- a/src/librustc_mir/transform/qualify_min_const_fn.rs +++ b/src/librustc_mir/transform/qualify_min_const_fn.rs @@ -396,11 +396,13 @@ fn is_intrinsic_whitelisted(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> bool | "min_align_of" | "needs_drop" // Arithmetic: - | "overflowing_add" // ~> wrapping_add - | "overflowing_sub" // ~> wrapping_sub - | "overflowing_mul" // ~> wrapping_mul - | "unchecked_shl" // ~> wrapping_shl - | "unchecked_shr" // ~> wrapping_shr + | "overflowing_add" // ~> .wrapping_add + | "overflowing_sub" // ~> .wrapping_sub + | "overflowing_mul" // ~> .wrapping_mul + | "unchecked_shl" // ~> .wrapping_shl + | "unchecked_shr" // ~> .wrapping_shr + | "rotate_left" // ~> .rotate_left + | "rotate_right" // ~> .rotate_right => true, _ => false, } |
