aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/torture/traits15.rs
blob: c1863a8a2f9bc63aec9d6e9abce95e4fc10649ff (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
#[lang = "sized"]
pub trait Sized {}

trait Foo<T> {
    type A;

    fn test(a: T, b: Self::A) -> (T, Self::A) {
        (a, b)
    }
}

struct Bar<T>(T);
impl<T> Foo<T> for Bar<T> {
    type A = T;
}

pub fn main() {
    let a;
    a = Bar(123);

    let b: <Bar<i32> as Foo<i32>>::A;
    b = 456;

    let c;
    c = <Bar<i32> as Foo<i32>>::test(a.0, 123);
}