]> git.lizzy.rs Git - rust.git/blob - tests/ui/macros/issue-61053-different-kleene.rs
Rollup merge of #107127 - uweigand:s390x-sanitizer, r=Mark-Simulacrum
[rust.git] / tests / ui / macros / issue-61053-different-kleene.rs
1 #![deny(meta_variable_misuse)]
2
3 macro_rules! foo {
4     () => {};
5     ( $( $i:ident = $($j:ident),+ );* ) => { $( $( $i = $j; )* )* };
6     //~^ ERROR meta-variable repeats with
7     ( $( $($j:ident),+ );* ) => { $( $( $j; )+ )+ }; //~ERROR meta-variable repeats with
8 }
9
10 macro_rules! bar {
11     () => {};
12     (test) => {
13         macro_rules! nested {
14             () => {};
15             ( $( $i:ident = $($j:ident),+ );* ) => { $( $( $i = $j; )* )* };
16             //~^ ERROR meta-variable repeats with
17             ( $( $($j:ident),+ );* ) => { $( $( $j; )+ )+ }; //~ERROR meta-variable repeats with
18         }
19     };
20     ( $( $i:ident = $($j:ident),+ );* ) => {
21         $(macro_rules! $i {
22             () => { 0 $( + $j )* }; //~ ERROR meta-variable repeats with
23         })*
24     };
25 }
26
27 fn main() {
28     foo!();
29     bar!();
30 }