-
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
Improve accuracy of mut_key
#7640
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @camsteffen (or someone else) soon. Please see the contribution instructions for more information. |
My personal opinion is that this case is out of scope for the lint. I think if a user defines a type with a pointer and a custom |
mut_key
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.
A few nits and this is nearly ready. Please update the changelog in your post to reflect added changes.
Wait hold on what's going on with the unit tests? It seems to be that my local build of clippy is producing different test results to the build in the PR checker. So when I |
Your test output is not including changes from recent PRs. Try rebasing, don't run with TESTNAME, and maybe try cargo clean. Or just don't check in unrelated changes. |
Aha I've figured out what's going - I appear to not have |
Yes finally! The tests are passing at last. |
Please squash some commits and I'll merge. |
Rebased down to two commits :). |
Thanks! @bors r+ |
📌 Commit b2ffb28 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
🎉🎉🎉🎉 |
Fixes #6745.
Whilst writing the tests for this, I noticed what I believe is a false negative (the code in @xFrednet's comment doesn't trigger the lint). Currently the tests contain a case for this (which is blatantly ignored), but I'm not at all sure how to implement this (since the lint currently behaves completely differently for ADTs). I'm not sure what should be done - on the one hand the extra test cases are misleading, but on the other hand they don't cause much harm and would save effort for anyone fixing that false negative.
changelog: Improve accuracy of
clippy::mutable_key_type
.