False positive for dropping_copy_types #112653
Labels
A-lint
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
The false positive detection done in rust-lang/rust-clippy#9491 is actually too restrictive. The test is whether drop is used with the following pattern:
pat => drop(fun(args, ...))
. In particular, this doesn't matchpat => drop(expr)
which would be more general and cover things likepat => drop(fun(args, ...)?)
(notice the?
).Here's an example where the false positive triggers:
The text was updated successfully, but these errors were encountered: