Fix #18604: next_power_of_two should panic on overflow
This commit is contained in:
parent
2278506f68
commit
15ea3d80da
1 changed files with 1 additions and 0 deletions
|
|
@ -2222,6 +2222,7 @@ macro_rules! uint_impl {
|
|||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[inline]
|
||||
#[rustc_inherit_overflow_checks]
|
||||
pub fn next_power_of_two(self) -> Self {
|
||||
self.one_less_than_next_power_of_two() + 1
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue