You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A-docsArea: 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.
A partial order is a reflexive, antisymmetric and transitive relation. The docs for PartialOrd call it a "trait for types that form a partial order". However, we only require transitivity (explicitly) and antisymmetry (by implication from conditions 1, 2, and 4 in the docs). We cannot require reflexivity because f32 and f64 are PartialOrd but x == x is true for them iff x is not NaN. The docs should make clear that reflexivity is not required.
The text was updated successfully, but these errors were encountered:
Muon
added
the
A-docs
Area: Documentation for any part of the project, including the compiler, standard library, and tools
label
May 5, 2025
jieyouxu
added
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
and removed
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
labels
May 5, 2025
A-docsArea: 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.
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
PartialOrd
call it a "trait for types that form a partial order". However, we only require transitivity (explicitly) and antisymmetry (by implication from conditions 1, 2, and 4 in the docs). We cannot require reflexivity becausef32
andf64
arePartialOrd
butx == x
is true for them iffx
is not NaN. The docs should make clear that reflexivity is not required.The text was updated successfully, but these errors were encountered: