aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/torture/traits6.rs
blob: f11735324f2f6ca8872a4a7374c18242bb6ddbf7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#[lang = "sized"]
pub trait Sized {}

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);
}