Clarifying behavior of #[derive(Ord, PartialOrd)] in doc comments.

Removing redundant statement about lexicographic ordering.
This commit is contained in:
Adam Perry 2016-02-08 22:57:24 -07:00
parent 75271d8f1a
commit e22770beeb

View File

@ -165,9 +165,8 @@ impl Ordering {
/// - total and antisymmetric: exactly one of `a < b`, `a == b` or `a > b` is true; and /// - 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 `>`. /// - 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]`. 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]`.
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
pub trait Ord: Eq + PartialOrd<Self> { pub trait Ord: Eq + PartialOrd<Self> {
/// This method returns an `Ordering` between `self` and `other`. /// 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 == /// total order. For example, for floating point numbers, `NaN < 0 == false` and `NaN >= 0 ==
/// false` (cf. IEEE 754-2008 section 5.11). /// 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"] #[lang = "ord"]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> { pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {