diff options
| author | Clar Charr <clar@charr.xyz> | 2018-05-15 12:52:16 -0400 |
|---|---|---|
| committer | Clar Charr <clar@charr.xyz> | 2018-05-15 22:24:04 -0400 |
| commit | 99cf5a92acba672845a3563c4abf98e663eaf5cd (patch) | |
| tree | d862b55b50e8c8330db487587d921e36598c5682 /src/libcore/num | |
| parent | a00e68ddc667e6ab110dd07c45ee10ca8ef90bbc (diff) | |
| download | rust-99cf5a92acba672845a3563c4abf98e663eaf5cd.tar.gz rust-99cf5a92acba672845a3563c4abf98e663eaf5cd.zip | |
Separate feature gate for wrapping_next_power_of_two
Diffstat (limited to 'src/libcore/num')
| -rw-r--r-- | src/libcore/num/mod.rs | 5 | ||||
| -rw-r--r-- | src/libcore/num/wrapping.rs | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 38f1688f0d5..97fcd8ebb50 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -3433,14 +3433,15 @@ the return value is wrapped to `0`. Basic usage: ``` -#![feature(wrapping_int_impl)] +#![feature(wrapping_next_power_of_two)] ", $Feature, " assert_eq!(2", stringify!($SelfT), ".wrapping_next_power_of_two(), 2); assert_eq!(3", stringify!($SelfT), ".wrapping_next_power_of_two(), 4); assert_eq!(", stringify!($SelfT), "::max_value().wrapping_next_power_of_two(), 0);", $EndFeature, " ```"), - #[unstable(feature = "wrapping_int_impl", issue = "32463")] + #[unstable(feature = "wrapping_next_power_of_two", issue = "32463", + reason = "needs decision on wrapping behaviour")] pub fn wrapping_next_power_of_two(self) -> Self { self.one_less_than_next_power_of_two().wrapping_add(1) } diff --git a/src/libcore/num/wrapping.rs b/src/libcore/num/wrapping.rs index 6d5783282b0..d7f87d37f5b 100644 --- a/src/libcore/num/wrapping.rs +++ b/src/libcore/num/wrapping.rs @@ -874,7 +874,7 @@ When return value overflows (i.e. `self > (1 << (N-1))` for type Basic usage: ``` -#![feature(wrapping_int_impl)] +#![feature(wrapping_next_power_of_two)] use std::num::Wrapping; assert_eq!(Wrapping(2", stringify!($t), ").next_power_of_two(), Wrapping(2)); @@ -882,7 +882,8 @@ assert_eq!(Wrapping(3", stringify!($t), ").next_power_of_two(), Wrapping(4)); assert_eq!(Wrapping(200_u8).next_power_of_two(), Wrapping(0)); ```"), #[inline] - #[unstable(feature = "wrapping_int_impl", issue = "32463")] + #[unstable(feature = "wrapping_next_power_of_two", issue = "32463", + reason = "needs decision on wrapping behaviour")] pub fn next_power_of_two(self) -> Self { Wrapping(self.0.wrapping_next_power_of_two()) } |
