rust/tests/ui/lint/must_not_suspend/mutex.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
247 B
Rust
Raw Normal View History

2021-09-27 10:43:30 -05:00
// edition:2018
#![feature(must_not_suspend)]
2021-09-27 10:43:30 -05:00
#![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() {
}