`PartialOrd` does not mention upfront that it omits reflexivity
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
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 duality, conditions 1-4 in the docs for PartialOrd, and the symmetry of == from the docs of PartialEq). We cannot require reflexivity because f32 and f64 are PartialOrd but x == x is true for them iff x is not NaN, which is mentioned later, but it's a bit buried. The docs should make clear upfront that reflexivity is not required.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the PartialOrd trait documentation at the linked std::cmp page, especially its opening description and the later section on strict and non-strict partial orders. Update the upfront explanation so it clearly states that reflexivity is not required, then verify that the rendered documentation accurately communicates the relationship to types such as f32 and f64.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100