diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-05-29 17:32:50 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-05-30 15:52:23 -0700 |
| commit | f4fa7c8a07a96cc9d0aae0bfc6515fb747f25341 (patch) | |
| tree | 6460c18d1af201ac4e5f620be2fb1c23da5320a2 /src/libstd/fmt.rs | |
| parent | e5e865b8044cef76bd33ba268a8cdea8a401c96c (diff) | |
| download | rust-f4fa7c8a07a96cc9d0aae0bfc6515fb747f25341.tar.gz rust-f4fa7c8a07a96cc9d0aae0bfc6515fb747f25341.zip | |
Register new snapshots
Diffstat (limited to 'src/libstd/fmt.rs')
| -rw-r--r-- | src/libstd/fmt.rs | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/src/libstd/fmt.rs b/src/libstd/fmt.rs index 9bca2f4248c..8dc2dd4bdb6 100644 --- a/src/libstd/fmt.rs +++ b/src/libstd/fmt.rs @@ -492,10 +492,6 @@ will look like `"\\{"`. use io::Writer; use io; -#[cfg(stage0)] -use option::None; -#[cfg(stage0)] -use repr; use result::{Ok, Err}; use str::{Str, StrAllocating}; use str; @@ -524,21 +520,6 @@ pub use core::fmt::{secret_float, secret_upper_exp, secret_lower_exp}; #[doc(hidden)] pub use core::fmt::{secret_pointer}; -#[doc(hidden)] -#[cfg(stage0)] -pub fn secret_poly<T: Poly>(x: &T, fmt: &mut Formatter) -> Result { - // FIXME #11938 - UFCS would make us able call the this method - // directly Poly::fmt(x, fmt). - x.fmt(fmt) -} - -/// Format trait for the `?` character -#[cfg(stage0)] -pub trait Poly { - /// Formats the value using the given formatter. - fn fmt(&self, &mut Formatter) -> Result; -} - /// The format function takes a precompiled format string and a list of /// arguments, to return the resulting formatted string. /// @@ -562,27 +543,6 @@ pub fn format(args: &Arguments) -> string::String{ str::from_utf8(output.unwrap().as_slice()).unwrap().into_string() } -#[cfg(stage0)] -impl<T> Poly for T { - fn fmt(&self, f: &mut Formatter) -> Result { - match (f.width, f.precision) { - (None, None) => { - match repr::write_repr(f, self) { - Ok(()) => Ok(()), - Err(..) => Err(WriteError), - } - } - - // If we have a specified width for formatting, then we have to make - // this allocation of a new string - _ => { - let s = repr::repr_to_str(self); - f.pad(s.as_slice()) - } - } - } -} - impl<'a> Writer for Formatter<'a> { fn write(&mut self, b: &[u8]) -> io::IoResult<()> { match (*self).write(b) { |
