Open
Description
I tried this code:
#![feature(macro_metavar_expr)]
macro_rules! foo {
($($t:ident)*) => { ${count(t, 4294967296)} };
}
macro_rules! bar {
( $( { $( [ $( ( $( $t:ident )* ) )* ] )* } )* ) => { ${count(t, 4294967296)} }
}
fn test() {
foo!();
bar!( { [] [] } );
}
I expected to see this happen: Fails to expand both macro calls, because the depth parameter (4294967296) is out of bounds for $t
fragment in both macros.
Instead, this happened: Compiled successfully, both macro calls expand to 0
.
Meta
rustc --version --verbose
:
1.71.0-nightly (2023-05-23 5ea3f0ae08c07472239a)
cc #83527
@rustbot label requires-nightly F-macro-metavar-expr