Summary
Fixes of this lint don't account for auto-Deref.
For example, where an IntoIterator is expected such as in Iterator::zip, if x.into_iter() is supplied then this lint can be triggered. But the fix does not account for cases where x is getting auto-Deref to invoke (*x).into_iter(). So x is the suggested fix, but *x is the correct fix.
Reproducer
I tried this code:
let x = &[1];
let y = &&[2];
let _ = x.iter().zip(y.into_iter());
I expected to see this happen:
valid fix, or no fix at all. (example of valid fix: replace y.into_iter() with *y)
Instead, this happened:
invalid fix, attempting to replace y.into_iter() with y.
Version
rustc 1.72.1 (d5c2e9c34 2023-09-13)
binary: rustc
commit-hash: d5c2e9c342b358556da91d61ed4133f6f50fc0c3
commit-date: 2023-09-13
host: x86_64-apple-darwin
release: 1.72.1
LLVM version: 16.0.5
Additional Labels
No response