test for forgetting locked mutex

This commit is contained in:
Ralf Jung 2022-06-25 15:45:45 -04:00
parent e5022bf48a
commit 7c025a8f0e

View File

@ -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());
}