Clippy: Wrongly suggests Option::if_let_else
in const function
#7902
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
Lint name: option_if_let_else
I tried this code:
Then clippy generated a warning:
I'm generally not a fan of this lint anyone, but I do it to hopefully be consistent with the rest of the ecosystem and juggling lints is really hard to do. However, replacing this particular code results in a failure to compile on stable as you cannot call if_let_else in a constant function. Meaning the resulting checked code fails to compile.
Meta
Rust version (
rustc -Vv
):The text was updated successfully, but these errors were encountered: