1 // ignore-windows: Concurrency on Windows is not supported yet.
2 // compile-flags: -Zmiri-ignore-leaks
4 //! Test that leaking threads works, and that their destructors are not executed.
6 use std::cell::RefCell;
9 impl Drop for LoudDrop {
11 eprintln!("Dropping {}", self.0);
16 static X: RefCell<Option<LoudDrop>> = RefCell::new(None);
20 X.with(|x| *x.borrow_mut() = Some(LoudDrop(0)));
22 let _detached = std::thread::spawn(|| {
23 X.with(|x| *x.borrow_mut() = Some(LoudDrop(1)));