From 49dc1a5e06a04c4cb6bd136f7dedb85719646e10 Mon Sep 17 00:00:00 2001 From: Fenrir Date: Thu, 15 Feb 2018 21:15:14 -0700 Subject: Updates for Rust 1.24 --- ctr-std/src/f64.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'ctr-std/src/f64.rs') diff --git a/ctr-std/src/f64.rs b/ctr-std/src/f64.rs index e4eea74..6f34f17 100644 --- a/ctr-std/src/f64.rs +++ b/ctr-std/src/f64.rs @@ -970,7 +970,7 @@ impl f64 { #[stable(feature = "float_bits_conv", since = "1.20.0")] #[inline] pub fn to_bits(self) -> u64 { - unsafe { ::mem::transmute(self) } + num::Float::to_bits(self) } /// Raw transmutation from `u64`. @@ -978,7 +978,7 @@ impl f64 { /// This is currently identical to `transmute::(v)` on all platforms. /// It turns out this is incredibly portable, for two reasons: /// - /// * Floats and Ints have the same endianess on all supported platforms. + /// * Floats and Ints have the same endianness on all supported platforms. /// * IEEE-754 very precisely specifies the bit layout of floats. /// /// However there is one caveat: prior to the 2008 version of IEEE-754, how @@ -1014,8 +1014,7 @@ impl f64 { #[stable(feature = "float_bits_conv", since = "1.20.0")] #[inline] pub fn from_bits(v: u64) -> Self { - // It turns out the safety issues with sNaN were overblown! Hooray! - unsafe { ::mem::transmute(v) } + num::Float::from_bits(v) } } -- cgit v1.2.3