False positive for unnecessary_lazy_evaluations #6343
Labels
C-bug
Category: Clippy is not doing the correct thing
I-suggestion-causes-error
Issue: The suggestions provided by this Lint cause an ICE/error when applied
A minimal example:
When
clippy::unnecessary_lazy_evaluations
is on, you get:The suggested fix is not well formed because it refers to variable
i
. A fix should check that the expression in the closure does not depend on any variables in the arguments. (This also arguably isn't a candidate for the lint, because the indexing expression has side effects and a possible computational cost as well.)Meta
cargo clippy -V
: clippy 0.0.212 (1773f60 2020-11-08)rustc -Vv
:The text was updated successfully, but these errors were encountered: