1
Fork 0

Rollup merge of #82256 - eddyb:time-passes-stderr, r=varkor

Print -Ztime-passes (and misc stats/logs) on stderr, not stdout.

I've tried not to change anything that looked similar to `rustc --print`, where people might use automation, and/or any "bulk" prints, such as dumping an entire Graphviz (`dot`) graph on stdout.

The reason I want `-Ztime-passes` to be on stderr like debug logging is I can get a complete (and correctly interleaved) view just by looking at stderr, which is merely a convenience when running `rustc`/Cargo directly, but even more important when it's nested in a build script, as Cargo will split the build script output into stdout (named `output`) and `stderr`.
This commit is contained in:
Dylan DPC 2021-02-18 16:57:43 +01:00 committed by GitHub
commit efdcb4301b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 64 additions and 64 deletions

View file

@ -66,13 +66,13 @@ impl<'k> StatCollector<'k> {
let mut total_size = 0;
println!("\n{}\n", title);
eprintln!("\n{}\n", title);
println!("{:<18}{:>18}{:>14}{:>14}", "Name", "Accumulated Size", "Count", "Item Size");
println!("----------------------------------------------------------------");
eprintln!("{:<18}{:>18}{:>14}{:>14}", "Name", "Accumulated Size", "Count", "Item Size");
eprintln!("----------------------------------------------------------------");
for (label, data) in stats {
println!(
eprintln!(
"{:<18}{:>18}{:>14}{:>14}",
label,
to_readable_str(data.count * data.size),
@ -82,8 +82,8 @@ impl<'k> StatCollector<'k> {
total_size += data.count * data.size;
}
println!("----------------------------------------------------------------");
println!("{:<18}{:>18}\n", "Total", to_readable_str(total_size));
eprintln!("----------------------------------------------------------------");
eprintln!("{:<18}{:>18}\n", "Total", to_readable_str(total_size));
}
}