diff --git a/library/test/src/console.rs b/library/test/src/console.rs index dc0123cf4326..e9dda98966de 100644 --- a/library/test/src/console.rs +++ b/library/test/src/console.rs @@ -137,7 +137,7 @@ fn current_test_count(&self) -> usize { // List the tests to console, and optionally to logfile. Filters are honored. pub fn list_tests_console(opts: &TestOpts, tests: Vec) -> io::Result<()> { let mut output = match term::stdout() { - None => OutputLocation::Raw(io::stdout()), + None => OutputLocation::Raw(io::stdout().lock()), Some(t) => OutputLocation::Pretty(t), };