Document the Zero trait

This commit is contained in:
Erick Tryzelaar 2013-09-12 06:39:45 -07:00
parent f107718a9b
commit 7c08abb0ce
2 changed files with 3 additions and 2 deletions

View File

@ -1717,7 +1717,8 @@ Supported traits for `deriving` are:
* `Clone` and `DeepClone`, to perform (deep) copies.
* `IterBytes`, to iterate over the bytes in a data type.
* `Rand`, to create a random instance of a data type.
* `Zero`, to create an zero (or empty) instance of a data type.
* `Default`, to create an empty instance of a data type.
* `Zero`, to create an zero instance of a numeric data type.
* `ToStr`, to convert to a string. For a type with this instance,
`obj.to_str()` has similar output as `fmt!("%?", obj)`, but it differs in that
each constituent field of the type must also implement `ToStr` and will have

View File

@ -2249,7 +2249,7 @@ enum ABC { A, B, C }
The full list of derivable traits is `Eq`, `TotalEq`, `Ord`,
`TotalOrd`, `Encodable` `Decodable`, `Clone`, `DeepClone`,
`IterBytes`, `Rand`, `Zero`, and `ToStr`.
`IterBytes`, `Rand`, `Default`, `Zero`, and `ToStr`.
# Crates and the module system