ref_option_ref should not trigger for mutable references #9682
Labels
C-bug
Category: Clippy is not doing the correct thing
good-first-issue
These issues are a good way to get started with Clippy
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
The lint tells you to use
Option<&T>
instead of&Option<&T>
because the former isCopy
so there's no point in passing around references. However, the lint seems to also triggers for&Option<&mut T>
and tells you to useOption<&mut T>
instead, which is notCopy
.Lint Name
ref_option_ref
Reproducer
I tried this code:
I saw this happen:
I expected to see this happen:
No lint warnings.
Version
Additional Labels
@rustbot label +l-suggestion-causes-error
The text was updated successfully, but these errors were encountered: