-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Document details of Ord for Tuples, Option, Result, others? #50727
Comments
Definitely seems like it can't be left undocumented. Changing the sort order of The sort order of derived ordering is mentioned in the docs: https://doc.rust-lang.org/std/cmp/trait.PartialOrd.html#derivable (same text is at Would you want it somewhere else as well? |
@durka Even if the impl for these is via a |
Documenting derived traits is a duplicate of #44118. Tuples, on the other hand, don't get their traits via derive. All those traits are applied via a macro, so it's possible to add docs there without extending the language to add arbitrary attributes to a derive. |
@steveklabnik @estebank I would like to take this up. |
…g, r=oli-obk Document tuple's Ord behavior as sequential Partially closing rust-lang#50727
…g, r=oli-obk Document tuple's Ord behavior as sequential Partially closing rust-lang#50727
Is there still something to do about this issue ? If yes, I would like to do it, but I see tuples have been documented and from what I understand the rest is apparently not needed. |
The ordering for
And then it lists two examples. The ordering for both The sort order for |
Closing this as the documentation now mentions this albeit in different places |
In #rust, we had a user ask if Ord for (A, B, C) checks left to right or right to left. (It's left to right.)
This should be documented in the stdlib docs somewhere.
Similarly, should be documented for other enums such as Option (Some(T) > None) and Result (uhh, didn't check) and possibly others where it could be something different.
The text was updated successfully, but these errors were encountered: