diff options
| author | Carol (Nichols || Goulding) <carol.nichols@gmail.com> | 2016-05-20 15:50:34 -0400 |
|---|---|---|
| committer | Carol (Nichols || Goulding) <carol.nichols@gmail.com> | 2016-05-23 10:03:44 -0400 |
| commit | 1e493fd979c826c44b2fa5d4b74302d405fbd17d (patch) | |
| tree | 02d2e434c51323ab1b64a58f867eb1d5caf51f76 /src/libcore/fmt | |
| parent | 4c6b6c200befdef9d5882a8edf135efc20de905a (diff) | |
| download | rust-1e493fd979c826c44b2fa5d4b74302d405fbd17d.tar.gz rust-1e493fd979c826c44b2fa5d4b74302d405fbd17d.zip | |
Add explanations about what derived trait implementations do
Diffstat (limited to 'src/libcore/fmt')
| -rw-r--r-- | src/libcore/fmt/mod.rs | 6 |
1 files changed, 5 insertions, 1 deletions
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 /// |
