-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingE-hardCall for participation: This a hard problem and requires more experience or effort to work onCall for participation: This a hard problem and requires more experience or effort to work onI-false-negativeIssue: The lint should have been triggered on code, but wasn'tIssue: The lint should have been triggered on code, but wasn't
Description
Example code
use std::cell::RefCell;
use std::future::Future;
#[allow(unused)]
async fn foo(x: &RefCell<u32>, bar: impl Future<Output=()>) {
async {
let mut y = x.borrow_mut();
*y += 1;
bar.await;
}.await;
}When running cargo clippy -- -W clippy::pedantic expected the warning this 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:
rustc 1.52.0-nightly (acca81892 2021-03-13)
binary: rustc
commit-hash: acca818928654807ed3bc1ce0e97df118f8716c8
commit-date: 2021-03-13
host: x86_64-pc-windows-msvc
release: 1.52.0-nightly
hcsch
Metadata
Metadata
Assignees
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingE-hardCall for participation: This a hard problem and requires more experience or effort to work onCall for participation: This a hard problem and requires more experience or effort to work onI-false-negativeIssue: The lint should have been triggered on code, but wasn'tIssue: The lint should have been triggered on code, but wasn't