Closed Mythra closed 2 years ago
@rustbot label +I-suggestion-causes-error
The option_if_let_else
was fixed not to warn in const function by https://github.com/rust-lang/rust-clippy/pull/7573. Can you try currently beta (1.57.0)?
Thanks! Sorry I missed that I did try looking for already existing PRs or issues but I guess not thoroughly enough! Seems to work for me on beta, thanks for the help'
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
):