aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/torture/traits14.rs
blob: ab546a88fae7cbaa0635268a446a8baef9a4b6bc (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) -> T {
        a
    }
}

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: <Bar<i32> as Foo<i32>>::A;
    c = <Bar<i32> as Foo<i32>>::test(a.0);
}