Invalid suggestion of option_if_let_else
causes a compilation error error[E0382]: Borrow of moved value
#6737
Labels
C-bug
Category: Clippy is not doing the correct thing
E-medium
Call for participation: Medium difficulty level problem and requires some initial experience.
I-suggestion-causes-error
Issue: The suggestions provided by this Lint cause an ICE/error when applied
L-pedantic
Lint: Belongs in the pedantic lint group
I tried this code:
and got the following lint trigger:
Using the suggested code leads to:
Playground
The
if let
is used in this case to usemv_value
in both branches. This is a limitation of themap_or
suggestion.Meta
cargo clippy -V
: clippy 0.1.51 (3682750 2021-02-02)rustc -Vv
:Keep up the good work 📎 🐧
The text was updated successfully, but these errors were encountered: