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