diff options
| author | Steve Klabnik <steve@steveklabnik.com> | 2015-06-30 15:37:45 -0400 |
|---|---|---|
| committer | Steve Klabnik <steve@steveklabnik.com> | 2015-06-30 15:37:45 -0400 |
| commit | 26ff4714dd0da1c10eeeaee045794c3c0282f274 (patch) | |
| tree | 4fcde93f5048feaf89fe2a1977325284ba6b44ba /src/libcore | |
| parent | 65b5c15384e7fad8868f375d7f1e6f765db0be21 (diff) | |
| parent | 516941b74f61f058625fab936ad0fd2c97943e22 (diff) | |
| download | rust-26ff4714dd0da1c10eeeaee045794c3c0282f274.tar.gz rust-26ff4714dd0da1c10eeeaee045794c3c0282f274.zip | |
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.
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/fmt/mod.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs index cbbb186af76..35dea6d15f0 100644 --- a/src/libcore/fmt/mod.rs +++ b/src/libcore/fmt/mod.rs @@ -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 \ |
