clippy::unnecessary_lazy_evaluations
produces a suggestion that would cause a divide-by-zero panic, despite the original code not causing such
#11722
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
I-suggestion-causes-error
Issue: The suggestions provided by this Lint cause an ICE/error when applied
Summary
As the title says, one of Clippy's lints has produced a suggestion that would cause a divide-by-zero panic. The code and clippy's suggestion are listed below, under the Reproducer header.
Lint Name
clippy::unnecessary_lazy_evaluations
Reproducer
I tried this code:
I saw this happen:
I expected to see this happen:
No lint triggering at all - or alternative code that would still avoid the same panic, like:
Version
Additional Labels
@rustbot label +I-suggestion-causes-error
The text was updated successfully, but these errors were encountered: