diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-12-05 20:43:40 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-05 20:43:40 +0100 |
| commit | 8ad447c4791807a096b575ccba9baec2e4ec937d (patch) | |
| tree | 59343998f08c1dd5f50db4aa440ae09e0e03e982 | |
| parent | 203c8765ea33c65d888febe0e8219c4bb11b0d89 (diff) | |
| parent | 34de2573f5a66f6f000d71f6933aa190dcfb17a1 (diff) | |
| download | rust-8ad447c4791807a096b575ccba9baec2e4ec937d.tar.gz rust-8ad447c4791807a096b575ccba9baec2e4ec937d.zip | |
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.
| -rw-r--r-- | library/core/src/cmp.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/library/core/src/cmp.rs b/library/core/src/cmp.rs index 5db5cbfc3df..949896e5748 100644 --- a/library/core/src/cmp.rs +++ b/library/core/src/cmp.rs @@ -29,8 +29,7 @@ use crate::marker::StructuralPartialEq; use self::Ordering::*; -/// Trait for equality comparisons which are [partial equivalence -/// relations](https://en.wikipedia.org/wiki/Partial_equivalence_relation). +/// Trait for equality comparisons. /// /// `x.eq(y)` can also be written `x == y`, and `x.ne(y)` can be written `x != y`. /// We use the easier-to-read infix notation in the remainder of this documentation. @@ -38,6 +37,8 @@ use self::Ordering::*; /// This trait allows for partial equality, for types that do not have a full /// equivalence relation. For example, in floating point numbers `NaN != NaN`, /// so floating point types implement `PartialEq` but not [`trait@Eq`]. +/// Formally speaking, when `Rhs == Self`, this trait corresponds to a [partial equivalence +/// relation](https://en.wikipedia.org/wiki/Partial_equivalence_relation). /// /// Implementations must ensure that `eq` and `ne` are consistent with each other: /// |
