summaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/torture/traits4.rs
blob: 67b012c11f587d82eee65c6a1dc8cd8e7ed63706 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
trait Foo {
    type A;
    type B;

    fn new(a: Self::A, b: Self::B) -> Self;
}

struct Baz(i32, f32);

impl Foo for Baz {
    type A = i32;
    type B = f32;

    fn new(a: Self::A, b: Self::B) -> Self {
        Baz(a, b)
    }
}

fn main() {
    Baz::new(123, 456f32);
}