Debian Codegraph @

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

raw
1 trait Foo {
2 type A;
3
4 fn test(a: Self::A) -> Self::A {
5 a
6 }
7 }
8
9 struct Bar(i32);
10 impl Foo for Bar {
11 type A = i32;
12 }
13
14 struct Baz(f32);
15 impl Foo for Baz {
16 type A = f32;
17 }
18
19 fn main() {
20 let a;
21 a = Bar(123);
22
23 let b;
24 b = Bar::test(a.0);
25
26 let c;
27 c = Baz(123f32);
28
29 let d;
30 d = Baz::test(c.0);
31 }