-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-macro_metavar_expr`#![feature(macro_metavar_expr)]``#![feature(macro_metavar_expr)]`requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.
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
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-macro_metavar_expr`#![feature(macro_metavar_expr)]``#![feature(macro_metavar_expr)]`requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.