aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/macro-issue1400.rs
blob: 5c51b78065c179428053b6fc127a90d826f4bbff (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
33
34
35
36
// { dg-additional-options "-w" }

#[lang = "sized"]
pub trait Sized {}

macro_rules! foo {
    ( ( $( $Trait: ident ),+ ) for $Ty: ident ) => {
        $(
            impl $Trait for $Ty {
                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}