Skip to content

Commit 99cf5a9

Browse files
author
Clar Charr
committed
Separate feature gate for wrapping_next_power_of_two
1 parent a00e68d commit 99cf5a9

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/libcore/num/mod.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -3433,14 +3433,15 @@ the return value is wrapped to `0`.
34333433
Basic usage:
34343434
34353435
```
3436-
#![feature(wrapping_int_impl)]
3436+
#![feature(wrapping_next_power_of_two)]
34373437
", $Feature, "
34383438
assert_eq!(2", stringify!($SelfT), ".wrapping_next_power_of_two(), 2);
34393439
assert_eq!(3", stringify!($SelfT), ".wrapping_next_power_of_two(), 4);
34403440
assert_eq!(", stringify!($SelfT), "::max_value().wrapping_next_power_of_two(), 0);",
34413441
$EndFeature, "
34423442
```"),
3443-
#[unstable(feature = "wrapping_int_impl", issue = "32463")]
3443+
#[unstable(feature = "wrapping_next_power_of_two", issue = "32463",
3444+
reason = "needs decision on wrapping behaviour")]
34443445
pub fn wrapping_next_power_of_two(self) -> Self {
34453446
self.one_less_than_next_power_of_two().wrapping_add(1)
34463447
}

src/libcore/num/wrapping.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -874,15 +874,16 @@ When return value overflows (i.e. `self > (1 << (N-1))` for type
874874
Basic usage:
875875
876876
```
877-
#![feature(wrapping_int_impl)]
877+
#![feature(wrapping_next_power_of_two)]
878878
use std::num::Wrapping;
879879
880880
assert_eq!(Wrapping(2", stringify!($t), ").next_power_of_two(), Wrapping(2));
881881
assert_eq!(Wrapping(3", stringify!($t), ").next_power_of_two(), Wrapping(4));
882882
assert_eq!(Wrapping(200_u8).next_power_of_two(), Wrapping(0));
883883
```"),
884884
#[inline]
885-
#[unstable(feature = "wrapping_int_impl", issue = "32463")]
885+
#[unstable(feature = "wrapping_next_power_of_two", issue = "32463",
886+
reason = "needs decision on wrapping behaviour")]
886887
pub fn next_power_of_two(self) -> Self {
887888
Wrapping(self.0.wrapping_next_power_of_two())
888889
}

0 commit comments

Comments
 (0)