@@ -916,14 +916,18 @@ pub macro Ord($item:item) {
916
916
/// easy to accidentally make them disagree by deriving some of the traits and manually
917
917
/// implementing others.
918
918
///
919
- /// The comparison must satisfy, for all `a`, `b` and `c`:
919
+ /// The comparison relations must satisfy the following conditions
920
+ /// (for all `a`, `b`, `c` of type `A`, `B`, `C`):
920
921
///
921
- /// - transitivity: `a < b` and `b < c` implies `a < c`. The same must hold for both `==` and `>`.
922
- /// - duality: `a < b` if and only if `b > a`.
922
+ /// - **Transitivity**: if `A: PartialOrd<B>` and `B: PartialOrd<C>` and `A:
923
+ /// PartialOrd<C>`, then `a < b` and `b < c` implies `a < c`. The same must hold for both `==` and `>`.
924
+ /// This must also work for longer chains, such as when `A: PartialOrd<B>`, `B: PartialOrd<C>`,
925
+ /// `C: PartialOrd<D>`, and `A: PartialOrd<D>` all exist.
926
+ /// - **Duality**: if `A: PartialOrd<B>` and `B: PartialOrd<A>`, then `a < b` if and only if `b > a`.
923
927
///
924
- /// Note that these requirements mean that the trait itself must be implemented symmetrically and
925
- /// transitively: if `T: PartialOrd<U>` and `U: PartialOrd<V>` then `U: PartialOrd<T>` and `T:
926
- /// PartialOrd<V>` .
928
+ /// Note that the `B: PartialOrd<A>` (dual) and `A: PartialOrd<C>`
929
+ /// (transitive) impls are not forced to exist, but these requirements apply
930
+ /// whenever they do exist .
927
931
///
928
932
/// Violating these requirements is a logic error. The behavior resulting from a logic error is not
929
933
/// specified, but users of the trait must ensure that such logic errors do *not* result in
0 commit comments