Nightly manual_unwrap_or_default
attempts to discard side effects
#12621
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
Summary
Clippy on current nightly fires
manual_unwrap_or_default
and proposes code that would remove side effects on at least theNone
branch.Lint Name
manual_unwrap_or_default
Reproducer
Given the code:
...clippy fires the
manual_unwrap_or_default
lint with this advice:While it is correct that 0 is the Default value for the type in question, if I were to follow its suggestion, it would remove the
sector_erase
call on theNone
case... which is kind of important.Version
Additional Labels
@rustbot label +I-suggestion-causes-error
The text was updated successfully, but these errors were encountered: