Skip to content

Commit

Permalink
test for forgetting locked mutex
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Jun 25, 2022
1 parent e5022bf commit 7c025a8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/pass/concurrency/mutex_leak.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// compile-flags: -Zmiri-ignore-leaks
use std::mem;
use std::sync::Mutex;

fn main() {
// Test for https://github.com/rust-lang/rust/issues/85434
let m = Mutex::new(5i32);
mem::forget(m.lock());
}

0 comments on commit 7c025a8

Please sign in to comment.