about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorCzipperz <czipperz@gmail.com>2018-12-29 17:48:43 -0500
committerCzipperz <czipperz@gmail.com>2018-12-29 17:48:43 -0500
commitcf3959c5b07a03da5e3682743c7596fc05ef68a2 (patch)
tree7cfe8862dbaee5b6b7ac410f36606d454e2171f6 /src/libcore
parent43d26b1f35401c9341154192db000db456ee5ca2 (diff)
downloadrust-cf3959c5b07a03da5e3682743c7596fc05ef68a2.tar.gz
rust-cf3959c5b07a03da5e3682743c7596fc05ef68a2.zip
Make std::cmp::Ord documentation specify what it means to agree with PartialEq
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/cmp.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs
index 9336b130d1b..8eff9a8c8a2 100644
--- a/src/libcore/cmp.rs
+++ b/src/libcore/cmp.rs
@@ -472,9 +472,10 @@ impl<T: Ord> Ord for Reverse<T> {
 /// Then you must define an implementation for `cmp()`. You may find it useful to use
 /// `cmp()` on your type's fields.
 ///
-/// Implementations of `PartialEq`, `PartialOrd`, and `Ord` *must* agree with each other. It's
-/// easy to accidentally make them disagree by deriving some of the traits and manually
-/// implementing others.
+/// 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.
 ///
 /// Here's an example where you want to sort people by height only, disregarding `id`
 /// and `name`: