Documentation of PartialEq has example that violates transitivity #66476
Labels
A-docs
Area: Documentation for any part of the project, including the compiler, standard library, and tools
C-bug
Category: This is a bug.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
The Documentation of
PartialEq
states that implementations must be transitive: for all for alla
,b
andc
,a == b
andb == c
impliesa == c
. This is followed by a note indicating that the transitivity must also hold ifa
,b
, andc
are of different types.However, the last example implementation in the documentation is not transitive:
I can think of three possible ways to fix this:
I can submit a pull request if I get some guidance which of the above solutions to choose (I personally have a weak preference for the second one).
The text was updated successfully, but these errors were encountered: