summaryrefslogtreecommitdiffstats
path: root/tests/ui/macros/issue-61053-missing-repetition.rs
blob: 6b36c730b82543aa2359043e4e76eddae01433f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#![deny(meta_variable_misuse)]

macro_rules! foo {
    () => {};
    ($( $i:ident = $($j:ident),+ );*) => { $( $i = $j; )* };
    //~^ ERROR variable 'j' is still repeating
}

macro_rules! bar {
    () => {};
    (test) => {
        macro_rules! nested {
            () => {};
            ($( $i:ident = $($j:ident),+ );*) => { $( $i = $j; )* };
            //~^ ERROR variable 'j' is still repeating
        }
    };
    ( $( $i:ident = $($j:ident),+ );* ) => {
        $(macro_rules! $i {
            () => { $j }; //~ ERROR variable 'j' is still repeating
        })*
    };
}

fn main() {
    foo!();
    bar!();
}