From 030b1ed7f709539f5ca422758e9fe00d173aee76 Mon Sep 17 00:00:00 2001 From: Jethro Beekman Date: Mon, 27 Aug 2018 09:57:51 -0700 Subject: Refactor stderr_prints_nothing into a more modular function --- src/libstd/sys/wasm/stdio.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/libstd/sys/wasm') diff --git a/src/libstd/sys/wasm/stdio.rs b/src/libstd/sys/wasm/stdio.rs index 023f29576a2..e51aba75333 100644 --- a/src/libstd/sys/wasm/stdio.rs +++ b/src/libstd/sys/wasm/stdio.rs @@ -70,6 +70,10 @@ pub fn is_ebadf(_err: &io::Error) -> bool { true } -pub fn stderr_prints_nothing() -> bool { - !cfg!(feature = "wasm_syscall") +pub fn panic_output() -> Option { + if cfg!(feature = "wasm_syscall") { + Stderr::new().ok() + } else { + None + } } -- cgit 1.4.1-3-g733a5