Skip to content

Commit 939a76e

Browse files
committed
No warnings for compiling disable_float config rust-lang#26449.
1 parent 669b966 commit 939a76e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/libcore/fmt/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use prelude::*;
1717
use cell::{Cell, RefCell, Ref, RefMut, BorrowState};
1818
use marker::PhantomData;
1919
use mem;
20+
#[cfg(not(disable_float))]
2021
use num::flt2dec;
2122
use ops::Deref;
2223
use result;
@@ -653,6 +654,7 @@ impl<'a> Formatter<'a> {
653654
/// Takes the formatted parts and applies the padding.
654655
/// Assumes that the caller already has rendered the parts with required precision,
655656
/// so that `self.precision` can be ignored.
657+
#[cfg(not(disable_float))]
656658
fn pad_formatted_parts(&mut self, formatted: &flt2dec::Formatted) -> Result {
657659
if let Some(mut width) = self.width {
658660
// for the sign-aware zero padding, we render the sign first and
@@ -689,6 +691,7 @@ impl<'a> Formatter<'a> {
689691
}
690692
}
691693

694+
#[cfg(not(disable_float))]
692695
fn write_formatted_parts(&mut self, formatted: &flt2dec::Formatted) -> Result {
693696
fn write_bytes(buf: &mut Write, s: &[u8]) -> Result {
694697
buf.write_str(unsafe { str::from_utf8_unchecked(s) })
@@ -1054,6 +1057,7 @@ impl<'a, T> Pointer for &'a mut T {
10541057
}
10551058
}
10561059

1060+
#[cfg(not(disable_float))]
10571061
// Common code of floating point Debug and Display.
10581062
fn float_to_decimal_common<T>(fmt: &mut Formatter, num: &T, negative_zero: bool) -> Result
10591063
where T: flt2dec::DecodableFloat
@@ -1078,6 +1082,7 @@ fn float_to_decimal_common<T>(fmt: &mut Formatter, num: &T, negative_zero: bool)
10781082
fmt.pad_formatted_parts(&formatted)
10791083
}
10801084

1085+
#[cfg(not(disable_float))]
10811086
// Common code of floating point LowerExp and UpperExp.
10821087
fn float_to_exponential_common<T>(fmt: &mut Formatter, num: &T, upper: bool) -> Result
10831088
where T: flt2dec::DecodableFloat

0 commit comments

Comments
 (0)