-
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
derive_hash_xor_eq deny deriving PartialEq when implementing Hash manually #2627
Comments
Jup, just a docs issue. Good eye |
I can't think of a good example where overriding the Hash while having a derived PartialEq would cause a problem. It's important that clippy stays as focused as possible. False positives detract. |
"Checks for deriving Hash but implementing PartialEq explicitly." is a valuable check, but I agree that the way this is currently implemented where it denies a custom |
Another use case for this is a situation where we have a subset of fields that define equality and there should only be exactly one of those instances (in a HashSet e.g.) despite other non-important fields being unequal. |
According to here
derive_hash_xor_eq "Checks for deriving Hash but implementing PartialEq explicitly." however even doing the reverse is denied too.
I have tried the minimal example below and still faced this problem:
Where running clippy results in this:
I am using the latest rust nightly and the latest clippy. (mac os)
I have tried to look at the code and this seems intentional -well even the name seems to imply so- so maybe only the documentation should change?
The text was updated successfully, but these errors were encountered: