From 23be3f4885688e5e0011005e2295c75168854c0a Mon Sep 17 00:00:00 2001 From: Fenrir Date: Sun, 21 Jan 2018 14:06:28 -0700 Subject: Recreate ctr-std from latest nightly --- ctr-std/src/num.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'ctr-std/src/num.rs') diff --git a/ctr-std/src/num.rs b/ctr-std/src/num.rs index b7618ac..a2c1339 100644 --- a/ctr-std/src/num.rs +++ b/ctr-std/src/num.rs @@ -18,7 +18,6 @@ #[stable(feature = "rust1", since = "1.0.0")] pub use core::num::{FpCategory, ParseIntError, ParseFloatError, TryFromIntError}; - #[stable(feature = "rust1", since = "1.0.0")] pub use core::num::Wrapping; @@ -170,10 +169,14 @@ mod tests { macro_rules! test_checked_next_power_of_two { ($test_name:ident, $T:ident) => ( + #[cfg_attr(target_os = "emscripten", ignore)] // FIXME(#39119) fn $test_name() { #![test] assert_eq!((0 as $T).checked_next_power_of_two(), Some(1)); - assert!(($T::MAX / 2).checked_next_power_of_two().is_some()); + let smax = $T::MAX >> 1; + assert_eq!(smax.checked_next_power_of_two(), Some(smax+1)); + assert_eq!((smax + 1).checked_next_power_of_two(), Some(smax + 1)); + assert_eq!((smax + 2).checked_next_power_of_two(), None); assert_eq!(($T::MAX - 1).checked_next_power_of_two(), None); assert_eq!($T::MAX.checked_next_power_of_two(), None); let mut next_power = 1; -- cgit v1.2.3