FP bool-to-int-with-if in const context #10452
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
.
Lint Name
bool-to-int-with-if
Reproducer
I tried this code:
I saw this happen:
The problem here is that the lint probably just checks "am I inside a const fn" but this is some which is false, BUT we are inside an array which still is some sort of const context and the lint misses this.
So the
if false { 0 } else { 1 }
is probably const-eval'd but this does not work withVersion
Additional Labels
No response
The text was updated successfully, but these errors were encountered: