Clippy recommending odd and broken (macro?) syntax in fix #7973
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
Running
cargo +nightly clippy
on my fork.The fix that is given to me for this
if let Some
:This fix doesn't compile at all, the syntax is just borked.
The original function:

The errors given when implementing the suggestion:

The right fix:
You can test this out on the codebase:
git clone https://github.com/sigaloid/vial cd vial/ git checkout dfc9b61cba9436baa87931bae389e114d342437e cargo +nightly clippy
(it's the third warning from the bottom)
If I had to guess it would be something to do with the fact that it's an if statement inside of map_or_else, or maybe the vec macro?
Meta
Rust version (
rustc -Vv
):@rustbot label +I-suggestion-causes-error
clippy: clippy::option_if_let_else
The text was updated successfully, but these errors were encountered: