From 445dadca33f5109398d819dd4dd408c291d110fb Mon Sep 17 00:00:00 2001 From: Czipperz Date: Sat, 29 Dec 2018 19:14:06 -0500 Subject: [PATCH] Specify criterion for PartialOrd --- src/libcore/cmp.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs index 8eff9a8c8a2..f420d0d00a4 100644 --- a/src/libcore/cmp.rs +++ b/src/libcore/cmp.rs @@ -474,8 +474,9 @@ impl Ord for Reverse { /// /// Implementations of `PartialEq`, `PartialOrd`, and `Ord` *must* /// agree with each other. That is, `a.cmp(b) == Ordering::Equal` if -/// and only if `a == b`. It's easy to accidentally make them disagree -/// by deriving some of the traits and manually implementing others. +/// and only if `a == b` and `Some(a.cmp(b)) == a.partial_cmp(b)` for +/// all `a` and `b`. It's easy to accidentally make them disagree by +/// deriving some of the traits and manually implementing others. /// /// Here's an example where you want to sort people by height only, disregarding `id` /// and `name`: