or_fun_call
suggestion causing error on temporary value
#9205
Labels
C-bug
Category: Clippy is not doing the correct thing
E-hard
Call for participation: This a hard problem and requires more experience or effort to work on
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
I found this error when using a reference of function return as optb in
or()
method, which was fine, but clippy suggesting me to useor_else
but applying the suggestion will breaks the code.Lint Name
or_fun_call
Reproducer
I tried this code:
I saw this happen:
but if I use the suggestion my code won't compile and gives below error:
I expected to see this happen:
offers a valid suggestion or no warning
Version
Additional Labels
@rustbot label +I-suggestion-causes-error
The text was updated successfully, but these errors were encountered: