about summary refs log tree commit diff
path: root/compiler/rustc_interface/src/passes.rs
diff options
context:
space:
mode:
authorJubilee <workingjubilee@gmail.com>2025-06-24 19:45:33 -0700
committerGitHub <noreply@github.com>2025-06-24 19:45:33 -0700
commitb5631095cd3fec73737a3883b07fcb0d7dbdcfb7 (patch)
tree2cbc122fa20cbf51662472cd1cb8acd428b115ac /compiler/rustc_interface/src/passes.rs
parent4af75b24e41de034dace6d1515d29d82e5604038 (diff)
parentc3200c3bb54b94bafb0731adeffd2128f1d6cdd3 (diff)
downloadrust-b5631095cd3fec73737a3883b07fcb0d7dbdcfb7.tar.gz
rust-b5631095cd3fec73737a3883b07fcb0d7dbdcfb7.zip
Rollup merge of #142934 - nnethercote:tweak-macro-stats, r=petrochenkov
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.

r? ```@petrochenkov```
Diffstat (limited to 'compiler/rustc_interface/src/passes.rs')
-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 e8c23ef997c..edfb05e2ccd 100644
--- a/compiler/rustc_interface/src/passes.rs
+++ b/compiler/rustc_interface/src/passes.rs
@@ -355,9 +355,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),
         );
     }