-
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
Fix some false-positive cases of explicit_auto_deref
#12976
Conversation
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, could you explain why #9841 is only partially fixed?
And could you also squash your comments down into a single one? |
The fix for #9841 does not seem to be general enough. If you add an extra ref and deref (ie the following code), a false positive still triggers, and an invalid suggestion is still issued. pub fn takes_array_ref<T, const N: usize>(array: &&&[T; N]) {
takes_slice(**array) // clippy still suggests to remove both dereferences
}
pub fn takes_slice<T>(_slice: &[T]) {
todo!()
} |
That makes sense, thank you :D Then we're just waiting for a squash of the commits =^.^= |
6c557e8
to
b03b342
Compare
Done!
That's because of #9841 (comment), which is important too. |
b03b342
to
68b9144
Compare
68b9144
to
c4c41d1
Compare
Thank you! Roses are red, |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
changelog: [
explicit_auto_deref
] Fix some false-positive casesFix part of #9841
Fix #12969
r? xFrednet