From e22770beeb30f8ca04ab74ecd56ee56dcc2a234e Mon Sep 17 00:00:00 2001 From: Adam Perry Date: Mon, 8 Feb 2016 22:57:24 -0700 Subject: [PATCH] Clarifying behavior of #[derive(Ord, PartialOrd)] in doc comments. Removing redundant statement about lexicographic ordering. --- src/libcore/cmp.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs index b8bf54628ac..042cbea64bd 100644 --- a/src/libcore/cmp.rs +++ b/src/libcore/cmp.rs @@ -165,9 +165,8 @@ impl Ordering { /// - total and antisymmetric: exactly one of `a < b`, `a == b` or `a > b` is true; and /// - transitive, `a < b` and `b < c` implies `a < c`. The same must hold for both `==` and `>`. /// -/// When this trait is `derive`d, it produces a lexicographic ordering. -/// -/// This trait can be used with `#[derive]`. +/// 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. #[stable(feature = "rust1", since = "1.0.0")] pub trait Ord: Eq + PartialOrd { /// This method returns an `Ordering` between `self` and `other`. @@ -225,7 +224,8 @@ impl PartialOrd for Ordering { /// total order. For example, for floating point numbers, `NaN < 0 == false` and `NaN >= 0 == /// false` (cf. IEEE 754-2008 section 5.11). /// -/// This trait can be used with `#[derive]`. +/// This trait can be used with `#[derive]`. When `derive`d, it will produce an ordering +/// based on the top-to-bottom declaration order of the struct's members. #[lang = "ord"] #[stable(feature = "rust1", since = "1.0.0")] pub trait PartialOrd: PartialEq {