Skip to content

Commit 7c025a8

Browse files
committed
test for forgetting locked mutex
1 parent e5022bf commit 7c025a8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/pass/concurrency/mutex_leak.rs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// compile-flags: -Zmiri-ignore-leaks
2+
use std::mem;
3+
use std::sync::Mutex;
4+
5+
fn main() {
6+
// Test for https://github.com/rust-lang/rust/issues/85434
7+
let m = Mutex::new(5i32);
8+
mem::forget(m.lock());
9+
}

0 commit comments

Comments
 (0)