@@ -63,6 +63,11 @@ use self::Ordering::*;
6363/// (transitive) impls are not forced to exist, but these requirements apply
6464/// whenever they do exist.
6565///
66+ /// Violating these requirements is a logic error. The behavior resulting from a logic error is not
67+ /// specified, but users of the trait must ensure that such logic errors do *not* result in
68+ /// undefined behavior. This means that `unsafe` code **must not** rely on the correctness of these
69+ /// methods.
70+ ///
6671/// ## Derivable
6772///
6873/// This trait can be used with `#[derive]`. When `derive`d on structs, two
@@ -250,6 +255,11 @@ pub macro PartialEq($item:item) {
250255/// This property cannot be checked by the compiler, and therefore `Eq` implies
251256/// [`PartialEq`], and has no extra methods.
252257///
258+ /// Violating this property is a logic error. The behavior resulting from a logic error is not
259+ /// specified, but users of the trait must ensure that such logic errors do *not* result in
260+ /// undefined behavior. This means that `unsafe` code **must not** rely on the correctness of these
261+ /// methods.
262+ ///
253263/// ## Derivable
254264///
255265/// This trait can be used with `#[derive]`. When `derive`d, because `Eq` has
@@ -656,6 +666,11 @@ impl<T: Clone> Clone for Reverse<T> {
656666/// It's easy to accidentally make `cmp` and `partial_cmp` disagree by
657667/// deriving some of the traits and manually implementing others.
658668///
669+ /// Violating these requirements is a logic error. The behavior resulting from a logic error is not
670+ /// specified, but users of the trait must ensure that such logic errors do *not* result in
671+ /// undefined behavior. This means that `unsafe` code **must not** rely on the correctness of these
672+ /// methods.
673+ ///
659674/// ## Corollaries
660675///
661676/// From the above and the requirements of `PartialOrd`, it follows that `<` defines a strict total order.
@@ -889,6 +904,11 @@ pub macro Ord($item:item) {
889904/// transitively: if `T: PartialOrd<U>` and `U: PartialOrd<V>` then `U: PartialOrd<T>` and `T:
890905/// PartialOrd<V>`.
891906///
907+ /// Violating these requirements is a logic error. The behavior resulting from a logic error is not
908+ /// specified, but users of the trait must ensure that such logic errors do *not* result in
909+ /// undefined behavior. This means that `unsafe` code **must not** rely on the correctness of these
910+ /// methods.
911+ ///
892912/// ## Corollaries
893913///
894914/// The following corollaries follow from the above requirements:
0 commit comments