aboutsummaryrefslogtreecommitdiff
path: root/libcore/fmt
diff options
context:
space:
mode:
authorpravic <[email protected]>2016-06-06 23:06:58 +0300
committerpravic <[email protected]>2016-06-06 23:06:58 +0300
commit1c889bacaf6b132e605638c5a8f9a78bdf8c7e67 (patch)
tree2b00929b29754929bfd86c868cd6cd6f1052c2bb /libcore/fmt
parentupdate to 2016-06-06 (diff)
parentapply libcore_nofp patch (diff)
downloadkmd-env-rs-1c889bacaf6b132e605638c5a8f9a78bdf8c7e67.tar.xz
kmd-env-rs-1c889bacaf6b132e605638c5a8f9a78bdf8c7e67.zip
Merge branch 'nofp_patch' into libcore_nofp
Diffstat (limited to 'libcore/fmt')
-rw-r--r--libcore/fmt/mod.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/libcore/fmt/mod.rs b/libcore/fmt/mod.rs
index 6579e5d..bf5a26b 100644
--- a/libcore/fmt/mod.rs
+++ b/libcore/fmt/mod.rs
@@ -17,6 +17,7 @@ use prelude::v1::*;
use cell::{UnsafeCell, Cell, RefCell, Ref, RefMut, BorrowState};
use marker::PhantomData;
use mem;
+#[cfg(not(disable_float))]
use num::flt2dec;
use ops::Deref;
use result;
@@ -1053,6 +1054,7 @@ impl<'a> Formatter<'a> {
/// Takes the formatted parts and applies the padding.
/// Assumes that the caller already has rendered the parts with required precision,
/// so that `self.precision` can be ignored.
+ #[cfg(not(disable_float))]
fn pad_formatted_parts(&mut self, formatted: &flt2dec::Formatted) -> Result {
if let Some(mut width) = self.width {
// for the sign-aware zero padding, we render the sign first and
@@ -1089,6 +1091,7 @@ impl<'a> Formatter<'a> {
}
}
+ #[cfg(not(disable_float))]
fn write_formatted_parts(&mut self, formatted: &flt2dec::Formatted) -> Result {
fn write_bytes(buf: &mut Write, s: &[u8]) -> Result {
buf.write_str(unsafe { str::from_utf8_unchecked(s) })
@@ -1477,6 +1480,7 @@ impl<'a, T: ?Sized> Pointer for &'a mut T {
}
}
+#[cfg(not(disable_float))]
// Common code of floating point Debug and Display.
fn float_to_decimal_common<T>(fmt: &mut Formatter, num: &T, negative_zero: bool) -> Result
where T: flt2dec::DecodableFloat
@@ -1501,6 +1505,7 @@ fn float_to_decimal_common<T>(fmt: &mut Formatter, num: &T, negative_zero: bool)
fmt.pad_formatted_parts(&formatted)
}
+#[cfg(not(disable_float))]
// Common code of floating point LowerExp and UpperExp.
fn float_to_exponential_common<T>(fmt: &mut Formatter, num: &T, upper: bool) -> Result
where T: flt2dec::DecodableFloat
@@ -1554,7 +1559,9 @@ macro_rules! floating { ($ty:ident) => {
}
}
} }
+#[cfg(not(disable_float))]
floating! { f32 }
+#[cfg(not(disable_float))]
floating! { f64 }
// Implementation of Display/Debug for various core types