needless_pass_by_ref_mut suggests (potentially unsound) code that triggers mut_from_ref #11180
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
needless_pass_by_ref_mut (warn by default) suggests code that triggers mut_from_ref (error by default).
The suggested code itself is also suspicious from a soundness point of view.
Mentioning @GuillaumeGomez, who implement this lint in #10900.
Reproducer
I tried this code:
This happened:
And when I applied the suggestion:
Then, this happened:
Version
Additional Labels
@rustbot label +I-false-positive +I-suggestion-causes-error
The text was updated successfully, but these errors were encountered: