about summary refs log tree commit diff
path: root/compiler/rustc_interface
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2025-06-24 08:42:14 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2025-06-24 08:42:14 +1000
commitc3200c3bb54b94bafb0731adeffd2128f1d6cdd3 (patch)
tree34fd315206a051d71e8a718e43c6afee0a89cc20 /compiler/rustc_interface
parent111e9bc64bbdce14122e3676978f2ceefa5bff1a (diff)
downloadrust-c3200c3bb54b94bafb0731adeffd2128f1d6cdd3.tar.gz
rust-c3200c3bb54b94bafb0731adeffd2128f1d6cdd3.zip
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.
Diffstat (limited to 'compiler/rustc_interface')
-rw-r--r--compiler/rustc_interface/src/passes.rs4
1 files changed, 2 insertions, 2 deletions
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} {:<name_w$}{:>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),
         );
     }