Open omni-corp opened 3 years ago
This false negative also occurs with await_holding_lock
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=6e840ea9a1e3ce8231aa6c76db10b50f
async fn _hold_lock() {
//async { // Uncomment this block and the clippy lint goes away
let lock = parking_lot::Mutex::new(());
let _guard = lock.lock();
let () = async {}.await;
//}.await
}
Example code
When running
cargo clippy -- -W clippy::pedantic
expected the warningthis RefCell Ref is held across an 'await' point. Consider ensuring the Ref is dropped before calling await
. Instead no warning is produced. Removing the async block produces the warning as expected.Meta
cargo clippy -V
:clippy 0.1.52 (acca8189 2021-03-13)
rustc -Vv
: