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

    fn baz(a: Self::A) -> Self::A;
}

struct Bar<T>(T);

impl<T> Foo for Bar<T> {
    type A = T;

    fn baz(a: Self::A) -> T {
        a
    }
}

fn main() {
    let a;
    a = Bar::<i32>::baz(123);
}