Rollup merge of #73219 - RalfJung:cargo-json, r=Mark-Simulacrum

x.py: with --json-output, forward cargo's JSON

Fixes https://github.com/rust-lang/rust/issues/73209

r? @Mark-Simulacrum
This commit is contained in:
Dylan DPC 2020-06-11 13:16:12 +02:00 committed by GitHub
commit ba0a8d2ee7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -983,7 +983,13 @@ pub fn stream_cargo(
for line in stdout.lines() {
let line = t!(line);
match serde_json::from_str::<CargoMessage<'_>>(&line) {
Ok(msg) => cb(msg),
Ok(msg) => {
if builder.config.json_output {
// Forward JSON to stdout.
println!("{}", line);
}
cb(msg)
}
// If this was informational, just print it out and continue
Err(_) => println!("{}", line),
}