]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/traits/suggest-fully-qualified-path-with-adjustment.rs
1 use std
::ops
::{Deref, DerefMut}
;
7 fn mut_method(&mut self) -> T
;
10 impl Method
<i32> for Thing
{
11 fn method(&self) -> i32 { 0 }
12 fn mut_method(&mut self) -> i32 { 0 }
15 impl Method
<u32> for Thing
{
16 fn method(&self) -> u32 { 0 }
17 fn mut_method(&mut self) -> u32 { 0 }
22 impl MethodRef
<i32> for &Thing
{
25 impl MethodRef
<u32> for &Thing
{
30 struct DerefsTo
<T
>(T
);
31 impl<T
> Deref
for DerefsTo
<T
> {
33 fn deref(&self) -> &Self::Target
{
37 impl<T
> DerefMut
for DerefsTo
<T
> {
38 fn deref_mut(&mut self) -> &mut Self::Target
{
44 let mut thing
= Thing
;
46 //~^ ERROR type annotations needed
47 //~| ERROR type annotations needed
48 thing
.mut_method(); //~ ERROR type annotations needed
49 thing
.by_self(); //~ ERROR type annotations needed
51 let mut deref_to
= DerefsTo(Thing
);
52 deref_to
.method(); //~ ERROR type annotations needed
53 deref_to
.mut_method(); //~ ERROR type annotations needed
54 deref_to
.by_self(); //~ ERROR type annotations needed
56 let mut deref_deref_to
= DerefsTo(DerefsTo(Thing
));
57 deref_deref_to
.method(); //~ ERROR type annotations needed
58 deref_deref_to
.mut_method(); //~ ERROR type annotations needed
59 deref_deref_to
.by_self(); //~ ERROR type annotations needed