Skip to content

Commit 7b95c7b

Browse files
committed
add regression test for allow-by-default must_not_suspend
1 parent d2766a9 commit 7b95c7b

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// edition:2018
2+
// run-pass
3+
4+
use std::sync::Mutex;
5+
6+
// Copied from the issue. Allow-by-default for now, so run-pass
7+
pub async fn foo() {
8+
let foo = Mutex::new(1);
9+
let lock = foo.lock().unwrap();
10+
11+
// Prevent mutex lock being held across `.await` point.
12+
drop(lock);
13+
14+
bar().await;
15+
}
16+
17+
async fn bar() {}
18+
19+
fn main() {}

0 commit comments

Comments
 (0)