Open
Description
Observed in #51754, the following main.rs
#![feature(trace_macros)]
trace_macros(true);
macro_rules! there_is_a_bug {
( $id:ident: $($tail:tt)* ) => {
there_is_a_bug! { $($tail:tt)* }
};
}
fn main() {
there_is_a_bug! { something: more {} }
}
never shows anything because it never hits an error. The reason that it never hits an error is the focus of #51754, but in summary rustc is performing clones that amount to time spent that is quadratic in the (already exponential) token stream length.
Ideally trace_macros
should produce output more strictly. I imagine it currently does not due to however it uses the diagnostics API.
Probably even once #51754 is fixed this example will still show nothing except out of memory (core dumped)
.