Skip to content

Commit 0239e46

Browse files
committed
Fix some bad formatting in -Zmacro-stats output.
I also double-checked that everything looks good on some real-world crates.
1 parent 347cd4e commit 0239e46

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

compiler/rustc_interface/src/passes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ fn print_macro_stats(ecx: &ExtCtxt<'_>) {
371371
// The name won't abut or overlap with the uses value, but it does
372372
// overlap with the empty part of the uses column. Shrink the width
373373
// of the uses column to account for the excess name length.
374-
uses_w = uses_with_underscores.len() + 1
374+
uses_w -= name.len() - name_w;
375375
};
376376

377377
_ = writeln!(

tests/ui/stats/macro-stats.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ macro-stats trait_tys! 1 2 2.0
2222
macro-stats n99! 2 2 1.0 4 2.0
2323
macro-stats none! 1 1 1.0 4 4.0
2424
macro-stats u32! 1 1 1.0 3 3.0
25-
macro-stats long_name_that_fits_on_one_line! 10 10 1.0 0 0.0
25+
macro-stats long_name_that_fits_on_one_line! 10 10 1.0 0 0.0
2626
macro-stats long_name_that_fits_on_one_line_____! 1 1 1.0 0 0.0
27-
macro-stats long_name_that_fits_on_one_line____! 1 1 1.0 0 0.0
28-
macro-stats long_name_that_fits_on_one_line___! 1 1 1.0 0 0.0
29-
macro-stats long_name_that_fits_on_one_line__! 1 1 1.0 0 0.0
30-
macro-stats long_name_that_fits_on_one_line_! 1 1 1.0 0 0.0
27+
macro-stats long_name_that_fits_on_one_line____! 1 1 1.0 0 0.0
28+
macro-stats long_name_that_fits_on_one_line___! 1 1 1.0 0 0.0
29+
macro-stats long_name_that_fits_on_one_line__! 1 1 1.0 0 0.0
30+
macro-stats long_name_that_fits_on_one_line_! 1 1 1.0 0 0.0
3131
macro-stats #[test] 1 1 1.0 0 0.0
3232
macro-stats ===================================================================================

0 commit comments

Comments
 (0)