needless_range_loop invalid suggesstion with mut iterator and take #5945
Labels
C-bug
Category: Clippy is not doing the correct thing
E-medium
Call for participation: Medium difficulty level problem and requires some initial experience.
I-suggestion-causes-error
Issue: The suggestions provided by this Lint cause an ICE/error when applied
Hello! I found a little bug with the needless_range_loop lint. It's suggestion produces a compiler error when attempting to mutably iterate over part of a collection.
For example:
Gives the following suggestion:
The suggested change doesn't compile however:
Playground Link
Meta
cargo clippy -V
: clippy 0.0.212 (663d2f5 2020-08-22)rustc -Vv
:The text was updated successfully, but these errors were encountered: