]> git.lizzy.rs Git - rust.git/blobdiff - src/libstd/sys/wasm/stdio.rs
Refactor stderr_prints_nothing into a more modular function
[rust.git] / src / libstd / sys / wasm / stdio.rs
index beb19c0ed2c1f62bd17b1611db911eb9a04eb7af..e51aba75333b651bcca5fdb213d631b100c5a88a 100644 (file)
@@ -69,3 +69,11 @@ fn flush(&mut self) -> io::Result<()> {
 pub fn is_ebadf(_err: &io::Error) -> bool {
     true
 }
+
+pub fn panic_output() -> Option<impl io::Write> {
+    if cfg!(feature = "wasm_syscall") {
+        Stderr::new().ok()
+    } else {
+        None
+    }
+}