about summary refs log tree commit diff
path: root/tests/ui/stats/auxiliary
AgeCommit message (Collapse)AuthorLines
2025-06-12Introduce `-Zmacro-stats`.Nicholas Nethercote-0/+3
It collects data about macro expansions and prints them in a table after expansion finishes. It's very useful for detecting macro bloat, especially for proc macros. Details: - It measures code snippets by pretty-printing them and then measuring lines and bytes. This required a bunch of additional pretty-printing plumbing, in `rustc_ast_pretty` and `rustc_expand`. - The measurement is done in `MacroExpander::expand_invoc`. - The measurements are stored in `ExtCtxt::macro_stats`.