rust/src/test/ui/lint/must_not_suspend/mutex.rs

13 lines
217 B
Rust
Raw Normal View History

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