-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
PartialOrd does not mention upfront that it omits reflexivity #140654
Copy link
Copy link
Open
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Location
https://doc.rust-lang.org/std/cmp/trait.PartialOrd.html
Summary
A partial order is a reflexive, antisymmetric and transitive relation. The docs for
PartialOrdcall it a "trait for types that form a partial order". However, we only require transitivity (explicitly) and antisymmetry (by implication from duality, conditions 1-4 in the docs forPartialOrd, and the symmetry of==from the docs ofPartialEq). We cannot require reflexivity becausef32andf64arePartialOrdbutx == xis true for them iffxis not NaN, which is mentioned later, but it's a bit buried. The docs should make clear upfront that reflexivity is not required.