@@ -63,6 +63,11 @@ use self::Ordering::*;
63
63
/// (transitive) impls are not forced to exist, but these requirements apply
64
64
/// whenever they do exist.
65
65
///
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
+ ///
66
71
/// ## Derivable
67
72
///
68
73
/// This trait can be used with `#[derive]`. When `derive`d on structs, two
@@ -250,6 +255,11 @@ pub macro PartialEq($item:item) {
250
255
/// This property cannot be checked by the compiler, and therefore `Eq` implies
251
256
/// [`PartialEq`], and has no extra methods.
252
257
///
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
+ ///
253
263
/// ## Derivable
254
264
///
255
265
/// This trait can be used with `#[derive]`. When `derive`d, because `Eq` has
@@ -656,6 +666,11 @@ impl<T: Clone> Clone for Reverse<T> {
656
666
/// It's easy to accidentally make `cmp` and `partial_cmp` disagree by
657
667
/// deriving some of the traits and manually implementing others.
658
668
///
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
+ ///
659
674
/// ## Corollaries
660
675
///
661
676
/// 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) {
889
904
/// transitively: if `T: PartialOrd<U>` and `U: PartialOrd<V>` then `U: PartialOrd<T>` and `T:
890
905
/// PartialOrd<V>`.
891
906
///
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
+ ///
892
912
/// ## Corollaries
893
913
///
894
914
/// The following corollaries follow from the above requirements:
0 commit comments