Document `PartialOrd` behavior for `Option<T> where T: PartialOrd`
@zepredos is already working on this.
Since Aug 26, 2026.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Location (URL)
https://doc.rust-lang.org/std/cmp/trait.PartialOrd.html#impl-PartialOrd-for-Option%3CT%3E
Summary
The behavior of impl<T> PartialOrd for Option<T> where T: PartialOrd isn't documented. One can take a look into the source code to check that, but I believe it would be better if it was explicitly documented like e.g. for impl PartialOrd for str or arrays, vectors, slices, etc. ("Implements comparison of ... lexicographically.")
I know that the policy is to maintain backwards compatibility and changing that behavior would be considered breaking, but I still believe it would be good to document the partial ordering strategy.
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.
Assessment
This issue has not been assessed yet.