Debian Codegraph @

gcc/testsuite/rust/compile/torture/traits6.rs

raw
1 #[lang = "sized"]
2 pub trait Sized {}
3
4 trait Foo {
5 type A;
6
7 fn baz(a: Self::A) -> Self::A;
8 }
9
10 struct Bar<T>(T);
11
12 impl<T> Foo for Bar<T> {
13 type A = T;
14
15 fn baz(a: Self::A) -> T {
16 a
17 }
18 }
19
20 fn main() {
21 let a;
22 a = Bar::<i32>::baz(123);
23 }