clippy::explicit_auto_deref
incorrectly removes deref in referenced deref
#12969
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::explicit_auto_deref
falsely triggers in expressions like&*foo
. Its suggestion does not compile.In this specific case,
clippy::explicit_auto_deref
should not trigger becauseclippy::needless_borrow
already triggers and provides the correct suggestion.This issue seems to be related to #9841
Lint Name
clippy::explicit_auto_deref
Reproducer
cargo clippy --fix
attempts to changefoo(&*wrapped_bar)
intofoo(wrapped_bar)
which does not compile. The following is the output given:It seems that
clippy::needless_borrow
provides the correct suggestion which is to change the code tofoo(*wrapped_bar)
which does not give any warnings.Version
No response
Additional Labels
@rustbot label +I-suggestion-causes-error
The text was updated successfully, but these errors were encountered: