aboutsummaryrefslogtreecommitdiff
path: root/libcore/fmt/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'libcore/fmt/mod.rs')
-rw-r--r--libcore/fmt/mod.rs9
1 files changed, 1 insertions, 8 deletions
diff --git a/libcore/fmt/mod.rs b/libcore/fmt/mod.rs
index 3637238..0c824b5 100644
--- a/libcore/fmt/mod.rs
+++ b/libcore/fmt/mod.rs
@@ -17,7 +17,6 @@ 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;
@@ -61,7 +60,7 @@ pub type Result = result::Result<(), Error>;
/// occurred. Any extra information must be arranged to be transmitted through
/// some other means.
#[stable(feature = "rust1", since = "1.0.0")]
-#[derive(Copy, Clone, Debug)]
+#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct Error;
/// A collection of methods that are required to format a message into a stream.
@@ -1024,7 +1023,6 @@ 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
@@ -1061,7 +1059,6 @@ 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) })
@@ -1450,7 +1447,6 @@ 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
@@ -1475,7 +1471,6 @@ 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
@@ -1529,9 +1524,7 @@ 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