Kill fmt::Show and fmt::String with fire!

Toss the tomatoes!
This commit is contained in:
Simonas Kazlauskas
2015-02-21 13:28:28 +02:00
parent 522d09dfec
commit e3104d8f0c
15 changed files with 19 additions and 52 deletions

View File

@@ -246,16 +246,6 @@ impl<'a> Display for Arguments<'a> {
}
}
/// Format trait for the `:?` format. Useful for debugging, all types
/// should implement this.
#[deprecated(since = "1.0.0", reason = "renamed to Debug")]
#[unstable(feature = "old_fmt")]
pub trait Show {
/// Formats the value using the given formatter.
#[stable(feature = "rust1", since = "1.0.0")]
fn fmt(&self, &mut Formatter) -> Result;
}
/// Format trait for the `:?` format. Useful for debugging, all types
/// should implement this.
#[stable(feature = "rust1", since = "1.0.0")]
@@ -269,22 +259,6 @@ pub trait Debug {
fn fmt(&self, &mut Formatter) -> Result;
}
#[allow(deprecated)]
impl<T: Show + ?Sized> Debug for T {
#[allow(deprecated)]
fn fmt(&self, f: &mut Formatter) -> Result { Show::fmt(self, f) }
}
/// When a value can be semantically expressed as a String, this trait may be
/// used. It corresponds to the default format, `{}`.
#[deprecated(since = "1.0.0", reason = "renamed to Display")]
#[unstable(feature = "old_fmt")]
pub trait String {
/// Formats the value using the given formatter.
#[stable(feature = "rust1", since = "1.0.0")]
fn fmt(&self, &mut Formatter) -> Result;
}
/// When a value can be semantically expressed as a String, this trait may be
/// used. It corresponds to the default format, `{}`.
#[rustc_on_unimplemented = "`{Self}` cannot be formatted with the default \
@@ -297,12 +271,6 @@ pub trait Display {
fn fmt(&self, &mut Formatter) -> Result;
}
#[allow(deprecated)]
impl<T: String + ?Sized> Display for T {
#[allow(deprecated)]
fn fmt(&self, f: &mut Formatter) -> Result { String::fmt(self, f) }
}
/// Format trait for the `o` character
#[stable(feature = "rust1", since = "1.0.0")]
pub trait Octal {