about summary refs log tree commit diff
path: root/src/libstd/sys/wasm/stdio.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/sys/wasm/stdio.rs')
-rw-r--r--src/libstd/sys/wasm/stdio.rs8
1 files changed, 6 insertions, 2 deletions
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<impl io::Write> {
+    if cfg!(feature = "wasm_syscall") {
+        Stderr::new().ok()
+    } else {
+        None
+    }
 }