Debian Codegraph @

gcc/testsuite/rust/compile/issue-2070.rs

raw
1 #[lang = "sized"]
2 pub trait Sized {}
3
4 trait Foo {
5 fn get(self) -> i32;
6 }
7
8 struct Bar(i32);
9 impl Foo for Bar {
10 fn get(self) -> i32 {
11 self.0
12 }
13 }
14
15 fn type_bound_test<T: Foo>(a: T) -> i32 {
16 Foo::get(a)
17 }
18
19 fn main() {
20 let a;
21 a = Bar(456);
22
23 let b;
24 b = type_bound_test(a);
25 }