about summary refs log tree commit diff
path: root/src/libstd/sys_common
diff options
context:
space:
mode:
authorJethro Beekman <jethro@fortanix.com>2018-08-27 09:57:51 -0700
committerJethro Beekman <jethro@fortanix.com>2018-12-06 20:37:15 +0530
commit030b1ed7f709539f5ca422758e9fe00d173aee76 (patch)
tree1253ea1024b9b7c872a32e688c1739772ad98204 /src/libstd/sys_common
parent367e783e6f66a4dba32decdc68a262953d2f3f1b (diff)
downloadrust-030b1ed7f709539f5ca422758e9fe00d173aee76.tar.gz
rust-030b1ed7f709539f5ca422758e9fe00d173aee76.zip
Refactor stderr_prints_nothing into a more modular function
Diffstat (limited to 'src/libstd/sys_common')
-rw-r--r--src/libstd/sys_common/util.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libstd/sys_common/util.rs b/src/libstd/sys_common/util.rs
index a373e980b97..fc86a59d17f 100644
--- a/src/libstd/sys_common/util.rs
+++ b/src/libstd/sys_common/util.rs
@@ -10,14 +10,13 @@
 
 use fmt;
 use io::prelude::*;
-use sys::stdio::{Stderr, stderr_prints_nothing};
+use sys::stdio::panic_output;
 use thread;
 
 pub fn dumb_print(args: fmt::Arguments) {
-    if stderr_prints_nothing() {
-        return
+    if let Some(mut out) = panic_output() {
+        let _ = out.write_fmt(args);
     }
-    let _ = Stderr::new().map(|mut stderr| stderr.write_fmt(args));
 }
 
 // Other platforms should use the appropriate platform-specific mechanism for