Can't disable no_effect
#7171
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-false-positive
Issue: The lint was triggered on code it shouldn't have
I'm using a
struct
with a customDerefMut
implementation that internally updates the object every time it's mutably de-referenced, as a way to check whether it has changed. To force an update, I'm using the following code:Despite appearances, the second line is not actually a no-op. I can't blame Clippy for not being able to figure that out. However, I'm not able to disable the lint warning, even with the
#[allow(clippy::no_effect)]
line.The following code replicates this bug. Note how
&mut *custom_deref;
is not a no-op, and note how the warning still shows despite disabling it.Output after
cargo clippy
:The text was updated successfully, but these errors were encountered: