aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/macro-issue1400-2.rs
blob: ba7b61b0b16632d0af2ebdb752f3d8aaca24b378 (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
29
30
31
32
macro_rules! foo {
    ( ( $( $Trait: ident ),+ ) for $($Ty: ident)* ) => {
        $(
            impl $Trait for $Ty {
    // { dg-error "different amount of matches used in merged repetitions: expected 4, got 1" "" { target *-*-* } .-1 }
                fn bar() -> i32 {
                    14
                }
            }
        )+
    }
}

trait Foo {
    fn bar() -> i32;
}

trait Bar {
    fn bar() -> i32;
}

trait Baz {
    fn bar() -> i32;
}

trait Qux {
    fn bar() -> i32;
}

struct S;

foo! {(Foo, Bar, Baz, Qux) for S}