From 1e493fd979c826c44b2fa5d4b74302d405fbd17d Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Fri, 20 May 2016 15:50:34 -0400 Subject: Add explanations about what derived trait implementations do --- src/libcore/fmt/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/libcore/fmt') diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs index dde4d03dad8..6579e5dab54 100644 --- a/src/libcore/fmt/mod.rs +++ b/src/libcore/fmt/mod.rs @@ -318,7 +318,11 @@ impl<'a> Display for Arguments<'a> { /// /// [module]: ../../std/fmt/index.html /// -/// This trait can be used with `#[derive]`. +/// This trait can be used with `#[derive]` if all fields implement `Debug`. When +/// `derive`d for structs, it will use the name of the `struct`, then `{`, then a +/// comma-separated list of each field's name and `Debug` value, then `}`. For +/// `enum`s, it will use the name of the variant and, if applicable, `(`, then the +/// `Debug` values of the fields, then `)`. /// /// # Examples /// -- cgit 1.4.1-3-g733a5