Make stats code nicer.

Taking inspiration from `-Zmacro-stats`:
- Use "{prefix}" consistently.
- Use names for column widths.
- Write output in a single `eprint!` call, in an attempt to minimize
  interleaving of output from different rustc processes.
- Use `repeat` for the long `---` banners.
This commit is contained in:
Nicholas Nethercote
2025-06-24 10:11:52 +10:00
parent 111e9bc64b
commit 8b1abd6578
3 changed files with 62 additions and 30 deletions

View File

@@ -370,7 +370,7 @@ fn early_lint_checks(tcx: TyCtxt<'_>, (): ()) {
let mut lint_buffer = resolver.lint_buffer.steal();
if sess.opts.unstable_opts.input_stats {
input_stats::print_ast_stats(krate, "POST EXPANSION AST STATS", "ast-stats");
input_stats::print_ast_stats(krate);
}
// Needs to go *after* expansion to be able to check the results of macro expansion.