Skip to content

False positive for await_holding_refcell_ref #6353

Open
@Daniel-B-Smith

Description

@Daniel-B-Smith

I tried this code:

let mut state = self.state.borrow_mut();
let handles = state.cancel_all_in_flight();
drop(state);
let to_cancel = handles.len();
let cancelled = stream::iter(handles).then(|f| f).count().await;

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions