-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Clarifying behavior of #[derive(Ord, PartialOrd)] in doc comments. #31510
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
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @steveklabnik (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
@@ -167,7 +167,8 @@ impl Ordering { | |||
/// | |||
/// When this trait is `derive`d, it produces a lexicographic ordering. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sentence should be removed since it's replaced by the edit below.
Last clarification was for issue #26620, but this is more complete. |
Quite right -- I'd intended to remove that and I'm not sure how I missed it. |
Can you use rebase to squash the changes together into one commit? With that, this change is r=me (any reviewer can approve it on my behalf.) |
Removing redundant statement about lexicographic ordering.
I haven't done that before in the middle of a PR -- did the squashed commits come through correctly? It looks like the new commit only has 1 parent, which is good, but I'm not sure I'm reading it correctly. |
@bors r+ Yes, everything looks right. Thank you! |
📌 Commit e22770b has been approved by |
Since a lexicographic ordering of a struct could vary based on which struct members are compared first, I ended up doing some testing to ensure that the behavior when deriving these traits was what I expected (ordered based on the top to bottom order of declaration of the members). I wanted to add this little bit of documentation to potentially save someone else the same effort. That is, assuming that my testing correctly reflects the intended behavior of the compiler. r? @steveklabnik
Since a lexicographic ordering of a struct could vary based on which struct members are compared first, I ended up doing some testing to ensure that the behavior when deriving these traits was what I expected (ordered based on the top to bottom order of declaration of the members). I wanted to add this little bit of documentation to potentially save someone else the same effort. That is, assuming that my testing correctly reflects the intended behavior of the compiler.
r? @steveklabnik