From 8c8ef9d5b88377f345220e577ca78e1713b87539 Mon Sep 17 00:00:00 2001 From: pravic Date: Fri, 29 Apr 2016 21:25:33 +0300 Subject: apply libcore_nofp patch --- libcore/num/flt2dec/decoder.rs | 3 +++ libcore/num/mod.rs | 9 +++++++++ 2 files changed, 12 insertions(+) (limited to 'libcore/num') diff --git a/libcore/num/flt2dec/decoder.rs b/libcore/num/flt2dec/decoder.rs index 6265691..0a28a14 100644 --- a/libcore/num/flt2dec/decoder.rs +++ b/libcore/num/flt2dec/decoder.rs @@ -12,6 +12,7 @@ use prelude::v1::*; +#[cfg(not(disable_float))] use {f32, f64}; use num::{Float, FpCategory}; @@ -57,10 +58,12 @@ pub trait DecodableFloat: Float + Copy { fn min_pos_norm_value() -> Self; } +#[cfg(not(disable_float))] impl DecodableFloat for f32 { fn min_pos_norm_value() -> Self { f32::MIN_POSITIVE } } +#[cfg(not(disable_float))] impl DecodableFloat for f64 { fn min_pos_norm_value() -> Self { f64::MIN_POSITIVE } } diff --git a/libcore/num/mod.rs b/libcore/num/mod.rs index 229a864..e966d1b 100644 --- a/libcore/num/mod.rs +++ b/libcore/num/mod.rs @@ -44,7 +44,9 @@ pub struct Wrapping(#[stable(feature = "rust1", since = "1.0.0")] pub T); mod wrapping; // All these modules are technically private and only exposed for libcoretest: +#[cfg(not(disable_float))] pub mod flt2dec; +#[cfg(not(disable_float))] pub mod dec2flt; pub mod bignum; pub mod diy_float; @@ -111,6 +113,7 @@ macro_rules! zero_one_impl_float { } )*) } +#[cfg(not(disable_float))] zero_one_impl_float! { f32 f64 } macro_rules! checked_op { @@ -2213,6 +2216,7 @@ pub enum FpCategory { #[unstable(feature = "core_float", reason = "stable interface is via `impl f{32,64}` in later crates", issue = "32110")] +#[cfg(not(disable_float))] pub trait Float: Sized { /// Returns the NaN value. #[unstable(feature = "float_extras", reason = "needs removal", @@ -2451,6 +2455,7 @@ impl fmt::Display for ParseIntError { } #[stable(feature = "rust1", since = "1.0.0")] +#[cfg(not(disable_float))] pub use num::dec2flt::ParseFloatError; // Conversion traits for primitive integer and float types @@ -2498,6 +2503,9 @@ impl_from! { u32, i64 } // they fit in the significand, which is 24 bits in f32 and 53 bits in f64. // Lossy float conversions are not implemented at this time. +#[cfg(not(disable_float))] +mod _int_flot_conv { +use convert::From; // Signed -> Float impl_from! { i8, f32 } impl_from! { i8, f64 } @@ -2514,3 +2522,4 @@ impl_from! { u32, f64 } // Float -> Float impl_from! { f32, f64 } +} -- cgit v1.2.3