From c3200c3bb54b94bafb0731adeffd2128f1d6cdd3 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Tue, 24 Jun 2025 08:42:14 +1000 Subject: Tweak `-Zmacro-stats` measurement. It currently reports net size, i.e. size(output) - size(input). After some use I think this is sub-optimal, and it's better to just report size(output). Because for derive macros the input size is always 1, and for attribute macros it's almost always 1. --- compiler/rustc_interface/src/passes.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'compiler/rustc_interface/src') diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs index 201b7e2b940..bba56281edd 100644 --- a/compiler/rustc_interface/src/passes.rs +++ b/compiler/rustc_interface/src/passes.rs @@ -354,9 +354,9 @@ fn print_macro_stats(ecx: &ExtCtxt<'_>) { "{prefix} {:uses_w$}{:>lines_w$}{:>avg_lines_w$}{:>bytes_w$}{:>avg_bytes_w$}", name, thousands::usize_with_underscores(uses), - thousands::isize_with_underscores(lines), + thousands::usize_with_underscores(lines), thousands::f64p1_with_underscores(avg_lines), - thousands::isize_with_underscores(bytes), + thousands::usize_with_underscores(bytes), thousands::f64p1_with_underscores(avg_bytes), ); } -- cgit 1.4.1-3-g733a5