From 7f646d916fd683988d4b9399bd5bc04586a31be7 Mon Sep 17 00:00:00 2001 From: Richo Healey Date: Sat, 28 Mar 2015 19:27:12 -0700 Subject: [PATCH] std: Flush stdout when print! is called --- src/libstd/io/stdio.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libstd/io/stdio.rs b/src/libstd/io/stdio.rs index d361f17cbe41b..a3360460e768c 100644 --- a/src/libstd/io/stdio.rs +++ b/src/libstd/io/stdio.rs @@ -403,6 +403,9 @@ pub fn _print(args: fmt::Arguments) { if let Err(e) = result { panic!("failed printing to stdout: {}", e); } + if let Err(e) = stdout().flush() { + panic!("failed to flush stdout: {}", e); + } } #[cfg(test)]