-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 pitfall with impl PartialEq<B> for A
#66566
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @rkruppe (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. |
Sorry for the two separate commits. I forgot to declare the counterexample as |
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.
LGTM (except for a typo), thanks!
Separate commits are generally good for review, we just squash them after review / before merging. Which in this case would be after fixing the typo, then I'll happily merge this.
src/libcore/cmp.rs
Outdated
/// ``` | ||
/// A comparison like the one above, which ignores some fields of the struct, | ||
/// can be dangerous. It can easily lead to an unintended violation of the | ||
/// requirements for a partial equivalence relation. Fore example, if we kept |
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.
Typo
/// requirements for a partial equivalence relation. Fore example, if we kept | |
/// requirements for a partial equivalence relation. For example, if we kept |
Thank you for fixing the typo, Dylan! @rkruppe Do you need me to squash or do you use the Github "Squash & Merge" feature? (Sorry, couldn't find this in the the contribution instructions.) |
We're not using any variant of Github's merge button, it all goes through our integration bot @bors. They can't squash, so it'll have to happen manually. Sorry for the confusion. |
Fixes rust-lang#66476 by turning the violating example into an explicit counterexample.
fbdf796
to
5028fd8
Compare
Squashed it into a single commit, should be ready to merge. |
Thanks! @bors r+ rollup |
📌 Commit 5028fd8 has been approved by |
Document pitfall with `impl PartialEq<B> for A` Fixes rust-lang#66476 by turning the violating example into an explicit counterexample.
Document pitfall with `impl PartialEq<B> for A` Fixes rust-lang#66476 by turning the violating example into an explicit counterexample.
Rollup of 8 pull requests Successful merges: - #66183 (*Syntactically* permit visibilities on trait items & enum variants) - #66566 (Document pitfall with `impl PartialEq<B> for A`) - #66575 (Remove pretty printing of specific nodes in AST) - #66587 (Handle statics in MIR as const pointers) - #66619 (follow the convention in this file to use third-person singular verbs) - #66633 (Error code's long explanation cleanup) - #66637 (fix reoccuring typo: dereferencable -> dereferenceable) - #66639 (resolve: more declarative `fresh_binding`) Failed merges: r? @ghost
Fixes #66476 by turning the violating example into an explicit
counterexample.