diff options
author | Scott McMurray <scottmcm@users.noreply.github.com> | 2017-11-03 21:48:33 -0700 |
---|---|---|
committer | Scott McMurray <scottmcm@users.noreply.github.com> | 2017-11-03 21:48:33 -0700 |
commit | 15ea3d80dacc4bb0919655e0f16e808ce83b5cf9 (patch) | |
tree | d907784906b2409aa270fcce9039fed4acf3ce54 | |
parent | 2278506f682062c7988c9e534a94366c56693981 (diff) | |
download | rust-15ea3d80dacc4bb0919655e0f16e808ce83b5cf9.tar.gz |
Fix #18604: next_power_of_two should panic on overflow
-rw-r--r-- | src/libcore/num/mod.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 5799d37c19c..914b3762d80 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -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 } |