2 Checks for calls to await while holding a `RefCell` `Ref` or `RefMut`.
5 `RefCell` refs only check for exclusive mutable access
6 at runtime. Holding onto a `RefCell` ref across an `await` suspension point
7 risks panics from a mutable ref shared while other refs are outstanding.
10 Will report false positive for explicitly dropped refs
11 ([#6353](https://github.com/rust-lang/rust-clippy/issues/6353)). A workaround for this is
12 to wrap the `.borrow[_mut]()` call in a block instead of explicitly dropping the ref.
16 async fn foo(x: &RefCell<u32>) {
17 let mut y = x.borrow_mut();
22 async fn bar(x: &RefCell<u32>) {
23 let mut y = x.borrow_mut();
25 drop(y); // explicit drop
32 async fn foo(x: &RefCell<u32>) {
34 let mut y = x.borrow_mut();
40 async fn bar(x: &RefCell<u32>) {
42 let mut y = x.borrow_mut();
44 } // y dropped here at end of scope