You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
False positive for await_holding_refcell_ref #6353
C-bugCategory: Clippy is not doing the correct thingE-hardCall for participation: This a hard problem and requires more experience or effort to work onI-false-positiveIssue: The lint was triggered on code it shouldn't have
I expected to see this happen: No error since the RefMut is explicitly dropped before the await
Instead, this happened: Brought up a warning
This happens in the recently promoted beta.
This should be pretty easy to fix. As a short term mitigation, I will downgrade the check from correctness and should hopefully be able to work on the fix next week.
Reacted by ldanko, Shinichi Kogai, Adrian Heine né Lang, Samuel, trevyn, Benjamin Saunders, Finn Bear, SSpirits, Kamil, Marcelo Diop-Gonzalez and 4 more
Apologies for the lack of communication. From conversations on Zulip, it is in fact not an easy fix to identify variables that have been explicitly dropped. I intended to add the documentation quickly, but got caught up in things. I just sent out #6585. Unfortunately, I don't have the cycles to dig into this deeply right now.
I believe this class of false positive was fixed -- I'm working on code that's doing explicit dropping of RefMuts in complex loops without any false positives from Clippy (though I have gotten a couple of true-positives!).
This still has no fix. If the scope of a binding extends past an await point it's erroneously assumed to be live by this lint. This isn't trivial to fix since this requires dataflow analysis to determine the value of any drop flags at await points. Alternatively the compiler could be changed to not store such values in the generator, although I'm not sure how that interacts with potential panics.
C-bugCategory: Clippy is not doing the correct thingE-hardCall for participation: This a hard problem and requires more experience or effort to work onI-false-positiveIssue: The lint was triggered on code it shouldn't have
Activity
Auto merge of #6354 - Daniel-B-Smith:refcell_ref_await, r=flip1995
Auto merge of #6354 - Daniel-B-Smith:refcell_ref_await, r=flip1995
khuey commentedon Jan 6, 2021
Any progress here?
Daniel-B-Smith commentedon Jan 13, 2021
Apologies for the lack of communication. From conversations on Zulip, it is in fact not an easy fix to identify variables that have been explicitly dropped. I intended to add the documentation quickly, but got caught up in things. I just sent out #6585. Unfortunately, I don't have the cycles to dig into this deeply right now.
Auto merge of #6585 - Daniel-B-Smith:false-positive-issue, r=flip1995
Auto merge of #6585 - Daniel-B-Smith:false-positive-issue, r=flip1995
Ralith commentedon May 21, 2022
This lint seems to have been enabled by default in 1.61 and is still producing false positives, breaking my CI.
Ralith commentedon Jun 18, 2022
Bump. This is still breaking my CI. Can we get it rolled back?
cbiffle commentedon Nov 9, 2025
I believe this class of false positive was fixed -- I'm working on code that's doing explicit dropping of RefMuts in complex loops without any false positives from Clippy (though I have gotten a couple of true-positives!).
AaronDewes commentedon Nov 12, 2025
I've still been getting such false positives with Rust 1.91 (
clippy 0.1.91 (f8297e351a 2025-10-28)), so it does not appear to be fully fixed.Jarcho commentedon Nov 12, 2025
This still has no fix. If the scope of a binding extends past an await point it's erroneously assumed to be live by this lint. This isn't trivial to fix since this requires dataflow analysis to determine the value of any drop flags at await points. Alternatively the compiler could be changed to not store such values in the generator, although I'm not sure how that interacts with potential panics.