From 15ea3d80dacc4bb0919655e0f16e808ce83b5cf9 Mon Sep 17 00:00:00 2001 From: Scott McMurray Date: Fri, 3 Nov 2017 21:48:33 -0700 Subject: Fix #18604: next_power_of_two should panic on overflow --- src/libcore/num/mod.rs | 1 + 1 file changed, 1 insertion(+) 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 } -- cgit 1.4.1-3-g733a5