summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBehnam Esfahbod <behnam@zwnj.org>2017-06-26 18:27:01 -0600
committerBehnam Esfahbod <behnam@zwnj.org>2017-06-26 18:37:54 -0600
commit330dab837fb872051b365715f1532eb8156c33ae (patch)
tree9a769d1c568d9e18153baa595e3bd8f83fb7bbb6 /src
parent859c3236e5ab974f24a82bbebffc72f58cf43800 (diff)
downloadrust-330dab837fb872051b365715f1532eb8156c33ae.tar.gz
[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.
Diffstat (limited to 'src')
-rw-r--r--src/libcore/cmp.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs
index 6f35d0417f1..2e691ea4af2 100644
--- a/src/libcore/cmp.rs
+++ b/src/libcore/cmp.rs
@@ -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`?
///