explicit_auto_deref
overeager with Any
#9143
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
Summary
My read is that this is a separate bug to those fixed in #9126, apologies if it is actually the same.
Lint Name
explicit_auto_deref
Reproducer
I tried this code, which completes successfully:
Clippy gives the following output
But replacing
as_any
with the suggestion:Causes the program to fail (
downcast_ref
now returnsNone
). This is (presumably) becauseself.0
has typeBox<dyn Any>
, which itself implementsAny
, so the suggested rewrite does not behave the same as the original code.Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: