Fix some false-positive cases of `explicit_auto_deref`
changelog: [explicit_auto_deref] Fix some false-positive cases
Partially fix OP of #9841 Fix #12969
r? @blyxyas
rustbot has assigned @blyxyas. They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.
Use r? to explicitly pick a reviewer
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 =^.^=
Then we're just waiting for a squash of the commits =^.^=
Done!
LGTM, could you explain why #9841 is only partially fixed?
That's because of https://github.com/rust-lang/rust-clippy/issues/9841#issuecomment-1925688007, which is important too.
Thank you!
Roses are red, The CI is green, Let's merge this quick, No conflicts seen
:pushpin: Commit c4c41d135227a0a34ddc941ccb6be9296e4cceff has been approved by xFrednet
It is now in the queue for this repository.
:hourglass: Testing commit c4c41d135227a0a34ddc941ccb6be9296e4cceff with merge 0f4035fde309871fd62ba6e3f641de00fe65738d...
:sunny: Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test Approved by: xFrednet Pushing 0f4035fde309871fd62ba6e3f641de00fe65738d to master...