Rollup merge of #26678 - bluss:doc-fmt, r=steveklabnik

fmt: Update docs and mention :#? pretty-printing

Expose `:#?` well in the docs for fmt and Debug itself. Also update some out of date information and fix formatting in `std::fmt` docs.
This commit is contained in:
Steve Klabnik 2015-06-30 15:37:45 -04:00
commit 26ff4714dd
2 changed files with 27 additions and 23 deletions

View file

@ -267,7 +267,7 @@ impl<'a> Display for Arguments<'a> {
}
}
/// Format trait for the `:?` format. Useful for debugging, all types
/// Format trait for the `?` character. Useful for debugging, all types
/// should implement this.
///
/// Generally speaking, you should just `derive` a `Debug` implementation.
@ -312,6 +312,9 @@ impl<'a> Display for Arguments<'a> {
/// There are a number of `debug_*` methods on `Formatter` to help you with manual
/// implementations, such as [`debug_struct`][debug_struct].
///
/// `Debug` implementations using either `derive` or the debug builder API
/// on `Formatter` support pretty printing using the alternate flag: `{:#?}`.
///
/// [debug_struct]: ../std/fmt/struct.Formatter.html#method.debug_struct
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_on_unimplemented = "`{Self}` cannot be formatted using `:?`; if it is \