about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorCzipperz <czipperz@gmail.com>2018-12-29 19:14:06 -0500
committerCzipperz <czipperz@gmail.com>2018-12-29 19:14:06 -0500
commit445dadca33f5109398d819dd4dd408c291d110fb (patch)
treee3829003eb8475d659cc4f91e894cf09d93cd95a /src/libcore
parentcf3959c5b07a03da5e3682743c7596fc05ef68a2 (diff)
downloadrust-445dadca33f5109398d819dd4dd408c291d110fb.tar.gz
rust-445dadca33f5109398d819dd4dd408c291d110fb.zip
Specify criterion for PartialOrd
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/cmp.rs5
1 files 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<T: Ord> Ord for Reverse<T> {
 ///
 /// 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`: