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

trait Foo {
    fn get(self) -> i32;
}

struct Bar(i32);
impl Foo for Bar {
    fn get(self) -> i32 {
        self.0
    }
}

fn type_bound_test<T: Foo>(a: T) -> i32 {
    Foo::get(a)
}

fn main() {
    let a;
    a = Bar(456);

    let b;
    b = type_bound_test(a);
}