rust-lang / rust-lang/rust

`PartialOrd` does not mention upfront that it omits reflexivity

Open Beginner friendly
#140,654 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

A-docs T-libs
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.