-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Allow implementing Hash
with derived PartialEq
(derive_hash_xor_eq
)
#10184
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @xFrednet (or someone else) soon. Please see the contribution instructions for more information. |
Hash
with derived PartialEq
(derive_hash_xor_eq
Hash
with derived PartialEq
(derive_hash_xor_eq
The lint name should be changed while you're at it. Something like |
Done |
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.
The logic looks good to me. Two small nits and then this should be ready for master.
@Jarcho Thank you for the suggestion to rename the lint, I probably would have missed that :)
Looks good to me, thank you for the update :) @bors r+ |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Hash
with derived PartialEq
(derive_hash_xor_eq
Hash
with derived PartialEq
(derive_hash_xor_eq
)
`clippy::derive_hash_xor_eq` is the problem. While it was default error on our current MSRV (1.56), it is now renamed and the meaning of the lint has changed (so that our code is no longer affected by the renamed lint). Related (rust-clippy): Allow implementing `Hash` with derived `PartialEq` (`derive_hash_xor_eq`) <rust-lang/rust-clippy#10184> As a workaround, it disables `renamed_and_removed_lints` lint unless in the maintaince mode.
`clippy::derive_hash_xor_eq` is the problem. While it was default error on our current MSRV (1.56), it is now renamed and the meaning of the lint has changed (so that our code is no longer affected by the renamed lint). Related (rust-clippy): Allow implementing `Hash` with derived `PartialEq` (`derive_hash_xor_eq`) <rust-lang/rust-clippy#10184> As a workaround, it disables `renamed_and_removed_lints` lint unless in the maintaince mode. This is a backport from the version 0.2.x development branch.
This is a common pattern and is totally allowed by the
Hash
trait.Fixes #2627
changelog: Move: Renamed
derive_hash_xor_eq
to [derived_hash_with_manual_eq
]#10184
changelog: Enhancement: [
derived_hash_with_manual_eq
]: Now allows#[derive(PartialEq)]
with customHash
implementations#10184