Debian Codegraph @

gcc/testsuite/rust/compile/torture/issue-808.rs

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