[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.
This commit is contained in:
parent
859c3236e5
commit
330dab837f
1 changed files with 6 additions and 4 deletions
|
|
@ -380,8 +380,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`?
|
||||
///
|
||||
|
|
@ -513,8 +514,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`?
|
||||
///
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue