Skip to content
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

PartialOrd documentation mixes functions and operators #87485

Closed
ChrisJefferson opened this issue Jul 26, 2021 · 3 comments
Closed

PartialOrd documentation mixes functions and operators #87485

ChrisJefferson opened this issue Jul 26, 2021 · 3 comments

Comments

@ChrisJefferson
Copy link
Contributor

ChrisJefferson commented Jul 26, 2021

The documentation for PartialOrd: https://doc.rust-lang.org/core/cmp/trait.PartialOrd.html

Tells me to implement functions partial_ord, and (possibly) lt, le, gt, ge. The documentation immediately starts talking about the Rust < and > operators, without ever saying how those operators relate to the functions in the trait. There also aren't any requirements put on le and ge (I'm not sure of the most compact and efficient way of listing the requirements on these operators. Is just saying "a <= b is true if and only if a<b or a==b is true" sufficient?).

@the8472
Copy link
Member

the8472 commented Jul 26, 2021

That context is provided on the module level. https://doc.rust-lang.org/core/cmp/index.html

@memoryruins
Copy link
Contributor

Beta and nightly's docs are much clearer about both parts after #85637

@ChrisJefferson
Copy link
Contributor Author

That solves all my problems. Thanks @RalfJung !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants