diff options
Diffstat (limited to 'src/test/ui/lint/must_not_suspend/mutex.rs')
-rw-r--r-- | src/test/ui/lint/must_not_suspend/mutex.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/ui/lint/must_not_suspend/mutex.rs b/src/test/ui/lint/must_not_suspend/mutex.rs new file mode 100644 index 000000000..7bb895e7d --- /dev/null +++ b/src/test/ui/lint/must_not_suspend/mutex.rs @@ -0,0 +1,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() { +} |