Skip to content

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

Merged
merged 1 commit into from
Feb 9, 2016
Merged

Conversation

anp
Copy link
Member

@anp anp commented Feb 9, 2016

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

@rust-highfive
Copy link
Contributor

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.
Copy link
Member

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.

@bluss
Copy link
Member

bluss commented Feb 9, 2016

Last clarification was for issue #26620, but this is more complete.

@anp
Copy link
Member Author

anp commented Feb 9, 2016

Quite right -- I'd intended to remove that and I'm not sure how I missed it.

@bluss
Copy link
Member

bluss commented Feb 9, 2016

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.
@anp
Copy link
Member Author

anp commented Feb 9, 2016

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.

@bluss
Copy link
Member

bluss commented Feb 9, 2016

@bors r+

Yes, everything looks right. Thank you!

@bors
Copy link
Collaborator

bors commented Feb 9, 2016

📌 Commit e22770b has been approved by bluss

bors added a commit that referenced this pull request Feb 9, 2016
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
@bors
Copy link
Collaborator

bors commented Feb 9, 2016

⌛ Testing commit e22770b with merge fc1c118...

@bors bors merged commit e22770b into rust-lang:master Feb 9, 2016
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

Successfully merging this pull request may close these issues.

5 participants