diff options
| author | Ariel Ben-Yehuda <arielb1@mail.tau.ac.il> | 2017-06-29 08:40:08 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-06-29 08:40:08 +0000 |
| commit | 647a36da73972c557825487e178bfc4ad1c0cc33 (patch) | |
| tree | 0591f63c87ece2cc844dabad4cbc236a09fbe1ad | |
| parent | bfe0098b66da3515f06a8d919ca954e5373cb0a4 (diff) | |
| parent | 330dab837fb872051b365715f1532eb8156c33ae (diff) | |
Rollup merge of #42920 - behnam:cmp, r=BurntSushi
[libcore/cmp] Expand Ord/PartialOrd Derivable doc for enum types Expand Derivable docblock section for `Ord` and `PartialOrd` to cover `enum` types, in addition to the existing language explaining it for `struct` types.
| -rw-r--r-- | src/libcore/cmp.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs index 33d2f729e1a..7882a8ce5c8 100644 --- a/src/libcore/cmp.rs +++ b/src/libcore/cmp.rs @@ -379,8 +379,9 @@ impl<T: Ord> Ord for Reverse<T> { /// /// ## Derivable /// -/// This trait can be used with `#[derive]`. When `derive`d, it will produce a lexicographic -/// ordering based on the top-to-bottom declaration order of the struct's members. +/// This trait can be used with `#[derive]`. When `derive`d on structs, it will produce a +/// lexicographic ordering based on the top-to-bottom declaration order of the struct's members. +/// When `derive`d on enums, variants are ordered by their top-to-bottom declaration order. /// /// ## How can I implement `Ord`? /// @@ -512,8 +513,9 @@ impl PartialOrd for Ordering { /// /// ## Derivable /// -/// This trait can be used with `#[derive]`. When `derive`d, it will produce a lexicographic -/// ordering based on the top-to-bottom declaration order of the struct's members. +/// This trait can be used with `#[derive]`. When `derive`d on structs, it will produce a +/// lexicographic ordering based on the top-to-bottom declaration order of the struct's members. +/// When `derive`d on enums, variants are ordered by their top-to-bottom declaration order. /// /// ## How can I implement `PartialOrd`? /// |
