Lint incorrectly fires when an anoymous mutex guard is used in a block inside an if..let statement #9209
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
The code below can be fixed by adding a local binding. But this looks to me like Clippy has misunderstood the flow of data.
Lint Name
await_holding_lock
Reproducer
I tried this code:
I saw this happen:
I expected to see this happen:
I did not expect to see an error because the guard returned from
self.ids.read()
(id
) is dropped at the end of the block which is part of the if statement.Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: