Skip to content

Commit 8ad447c

Browse files
authored
Rollup merge of #104912 - RalfJung:per, r=Mark-Simulacrum
PartialEq: PERs are homogeneous PartialEq claims that it corresponds to a PER, but that is only a well-defined statement when `Rhs == Self`. There is no standard notion of PER on a relation between two different sets/types. So move this out of the first paragraph and clarify this.
2 parents 203c876 + 34de257 commit 8ad447c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

library/core/src/cmp.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,16 @@ use crate::marker::StructuralPartialEq;
2929

3030
use self::Ordering::*;
3131

32-
/// Trait for equality comparisons which are [partial equivalence
33-
/// relations](https://en.wikipedia.org/wiki/Partial_equivalence_relation).
32+
/// Trait for equality comparisons.
3433
///
3534
/// `x.eq(y)` can also be written `x == y`, and `x.ne(y)` can be written `x != y`.
3635
/// We use the easier-to-read infix notation in the remainder of this documentation.
3736
///
3837
/// This trait allows for partial equality, for types that do not have a full
3938
/// equivalence relation. For example, in floating point numbers `NaN != NaN`,
4039
/// so floating point types implement `PartialEq` but not [`trait@Eq`].
40+
/// Formally speaking, when `Rhs == Self`, this trait corresponds to a [partial equivalence
41+
/// relation](https://en.wikipedia.org/wiki/Partial_equivalence_relation).
4142
///
4243
/// Implementations must ensure that `eq` and `ne` are consistent with each other:
4344
///

0 commit comments

Comments
 (0)