summaryrefslogtreecommitdiffstats
path: root/tests/ui/lint/must_not_suspend/mutex.rs
blob: 7bb895e7d36438f143181273f304f4d2c017f374 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// edition:2018
#![feature(must_not_suspend)]
#![deny(must_not_suspend)]

async fn other() {}

pub async fn uhoh(m: std::sync::Mutex<()>) {
    let _guard = m.lock().unwrap(); //~ ERROR `MutexGuard` held across
    other().await;
}

fn main() {
}