Skip to content

Commit

Permalink
Rollup merge of rust-lang#37066 - nrc:stderr, r=alexcrichton
Browse files Browse the repository at this point in the history
Error monitor should emit error to stderr instead of stdout

We are pretty consistent about emitting to stderr, except for when there is actually an error, in which case we emit to stdout. This seems a bit backwards. This PR just changes that exception to emit to stderr. This is useful for the RLS since the LS protocol uses stdout (grrr).

r? @alexcrichton
  • Loading branch information
alexcrichton committed Oct 12, 2016
2 parents f05bd1b + 4df0f3f commit 920f109
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustc_driver/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,7 @@ pub fn monitor<F: FnOnce() + Send + 'static>(f: F) {
errors::Level::Note);
}

println!("{}", str::from_utf8(&data.lock().unwrap()).unwrap());
writeln!(io::stderr(), "{}", str::from_utf8(&data.lock().unwrap()).unwrap()).unwrap();
}

exit_on_err();
Expand Down

0 comments on commit 920f109

Please sign in to comment.