use super::*; use crate::panic::{RefUnwindSafe, UnwindSafe}; use crate::thread; #[test] fn stdout_unwind_safe() { assert_unwind_safe::(); } #[test] fn stdoutlock_unwind_safe() { assert_unwind_safe::>(); assert_unwind_safe::>(); } #[test] fn stderr_unwind_safe() { assert_unwind_safe::(); } #[test] fn stderrlock_unwind_safe() { assert_unwind_safe::>(); assert_unwind_safe::>(); } fn assert_unwind_safe() {} #[test] #[cfg_attr(target_os = "emscripten", ignore)] fn panic_doesnt_poison() { thread::spawn(|| { let _a = stdin(); let _a = _a.lock(); let _a = stdout(); let _a = _a.lock(); let _a = stderr(); let _a = _a.lock(); panic!(); }) .join() .unwrap_err(); let _a = stdin(); let _a = _a.lock(); let _a = stdout(); let _a = _a.lock(); let _a = stderr(); let _a = _a.lock(); }