fix: `manual_memcpy` wrong indexing for multi dimensional arrays
fixes: #9334
This PR fixes an invalid suggestion for multi-dimensional arrays.
For example,
let src = vec![vec![0; 5]; 5];
let mut dst = vec![0; 5];
for i in 0..5 {
dst[i] = src[i][i];
}
For the above code, Clippy suggests dst.copy_from_slice(&src[i]);, but it is not compilable because i is only used to loop the array.
I adjusted it so that Clippy manual_memcpy works properly for multi-dimensional arrays.
changelog: [manual_memcpy]: Fixes invalid indexing suggestions for multi-dimensional arrays
r? @Alexendoo
(rustbot has picked a reviewer for you, use r? to override)
:umbrella: The latest upstream changes (presumably #12198) made this pull request unmergeable. Please resolve the merge conflicts.
Hi @Alexendoo , this is just a friendly reminder about this PR. It would be appreciated if you could review it when you have time? Thak you!
:umbrella: The latest upstream changes (presumably #12306) made this pull request unmergeable. Please resolve the merge conflicts.
Thank you!
@bors r+
:pushpin: Commit dfedadc179dc3c388e0b0098a910658bc6e820ef has been approved by Alexendoo
It is now in the queue for this repository.
:hourglass: Testing commit dfedadc179dc3c388e0b0098a910658bc6e820ef with merge e865dca4d76a204e002c223cba1dc804ee9b7c56...
:sunny: Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test Approved by: Alexendoo Pushing e865dca4d76a204e002c223cba1dc804ee9b7c56 to master...