Skip to content

PartialOrd does not mention it omits reflexivity #140654

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Muon opened this issue May 5, 2025 · 0 comments
Open

PartialOrd does not mention it omits reflexivity #140654

Muon opened this issue May 5, 2025 · 0 comments
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools T-libs Relevant to the library team, which will review and decide on the PR/issue.

Comments

@Muon
Copy link

Muon commented May 5, 2025

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 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.

@Muon Muon added the A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools label May 5, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label May 5, 2025
@jieyouxu 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants