1 /* { dg-output "foo_deref\nimm_deref\n123\n" } */
3 fn printf(s: *const i8, ...);
10 fn deref(&self) -> &Self::Target;
13 impl<T> Deref for &T {
16 fn deref(&self) -> &T {
18 let a = "imm_deref\n\0";
19 let b = a as *const str;
20 let c = b as *const i8;
29 impl<T> Deref for &mut T {
32 fn deref(&self) -> &T {
34 let a = "mut_deref\n\0";
35 let b = a as *const str;
36 let c = b as *const i8;
46 impl<T> Deref for Foo<T> {
49 fn deref(&self) -> &Self::Target {
51 let a = "foo_deref\n\0";
52 let b = a as *const str;
53 let c = b as *const i8;
64 let bar = &foo as &i32;
68 let b = a as *const str;
69 let c = b as *const i8;