We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1b19e64 commit 0d745afCopy full SHA for 0d745af
src/libcore/num/mod.rs
@@ -15,6 +15,7 @@
15
use convert::{Infallible, TryFrom};
16
use fmt;
17
use intrinsics;
18
+use ops;
19
use str::FromStr;
20
21
/// Provides intentionally-wrapped arithmetic on `T`.
@@ -2222,9 +2223,9 @@ macro_rules! uint_impl {
2222
2223
/// ```
2224
#[stable(feature = "rust1", since = "1.0.0")]
2225
#[inline]
- #[rustc_inherit_overflow_checks]
2226
pub fn next_power_of_two(self) -> Self {
2227
- self.one_less_than_next_power_of_two() + 1
+ // Call the trait to get overflow checks
2228
+ ops::Add::add(self.one_less_than_next_power_of_two(), 1)
2229
}
2230
2231
/// Returns the smallest power of two greater than or equal to `n`. If
0 commit comments