=
");
@@ -1470,7 +1470,7 @@ fn item_typedef(w: &mut Writer, it: &clean::Item, t: &clean::Typedef) {
document(w, it);
}
-impl<'a> fmt::Default for Sidebar<'a> {
+impl<'a> fmt::Format for Sidebar<'a> {
fn fmt(s: &Sidebar<'a>, fmt: &mut fmt::Formatter) {
let cx = s.cx;
let it = s.item;
@@ -1535,7 +1535,7 @@ fn build_sidebar(m: &clean::Module) -> HashMap<~str, ~[~str]> {
return map;
}
-impl<'a> fmt::Default for Source<'a> {
+impl<'a> fmt::Format for Source<'a> {
fn fmt(s: &Source<'a>, fmt: &mut fmt::Formatter) {
let lines = s.lines().len();
let mut cols = 0;
diff --git a/src/libstd/fmt/mod.rs b/src/libstd/fmt/mod.rs
index 53eaf17c7f876..6b579ce4d428b 100644
--- a/src/libstd/fmt/mod.rs
+++ b/src/libstd/fmt/mod.rs
@@ -147,13 +147,13 @@ The current mapping of types to traits is:
* `p` ⇒ `Pointer`
* `t` ⇒ `Binary`
* `f` ⇒ `Float`
-* *nothing* ⇒ `Default`
+* *nothing* ⇒ `Format`
What this means is that any type of argument which implements the
`std::fmt::Binary` trait can then be formatted with `{:t}`. Implementations are
provided for these traits for a number of primitive types by the standard
library as well. If no format is specified (as in `{}` or `{:6}`), then the
-format trait used is the `Default` trait. This is one of the more commonly
+format trait used is the `Format` trait. This is one of the more commonly
implemented traits when formatting a custom type.
When implementing a format trait for your own time, you will have to implement a
@@ -184,7 +184,7 @@ struct Vector2D {
y: int,
}
-impl fmt::Default for Vector2D {
+impl fmt::Format for Vector2D {
fn fmt(obj: &Vector2D, f: &mut fmt::Formatter) {
// The `f.buf` value is of the type `&mut io::Writer`, which is what th
// write! macro is expecting. Note that this formatting ignores the
@@ -481,6 +481,18 @@ use vec;
pub mod parse;
pub mod rt;
+/// NOTE: This is a temporary fix as we purge the `fmt::Default` trait from the
+/// compiler. This should be removed at the next snapshot.
+#[cfg(stage0)]
+#[allow(missing_doc)]
+pub mod Default {
+ use super::{Format, Formatter};
+
+ pub fn fmt, f: &mut fmt::Formatter) {
d.with_str(|s| f.pad(s))
}
diff --git a/src/libstd/result.rs b/src/libstd/result.rs
index 4e8db15a92ebd..c1ea05171d97e 100644
--- a/src/libstd/result.rs
+++ b/src/libstd/result.rs
@@ -205,7 +205,7 @@ impl