From 516941b74f61f058625fab936ad0fd2c97943e22 Mon Sep 17 00:00:00 2001 From: Ulrik Sverdrup Date: Tue, 30 Jun 2015 14:10:24 +0200 Subject: fmt: Update docs and mention :#? pretty-printing --- src/libcore/fmt/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/libcore') 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 \ -- cgit 1.4.1-3-g733a5 From 8b81f76593ce044b0d822f07061c93b515f7dc01 Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Tue, 30 Jun 2015 18:46:31 -0400 Subject: Make note of Ord's derive ordering Fixes #26620 --- src/libcore/cmp.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/libcore') diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs index 0269499ad54..52ed29c1b61 100644 --- a/src/libcore/cmp.rs +++ b/src/libcore/cmp.rs @@ -166,6 +166,8 @@ impl Ordering { /// /// - total and antisymmetric: exactly one of `a < b`, `a == b` or `a > b` is true; and /// - transitive, `a < b` and `b < c` implies `a < c`. The same must hold for both `==` and `>`. +/// +/// When this trait is `derive`d, it produces a lexicographic ordering. #[stable(feature = "rust1", since = "1.0.0")] pub trait Ord: Eq + PartialOrd { /// This method returns an `Ordering` between `self` and `other`. -- cgit 1.4.1-3-g733a5