diff options
Diffstat (limited to 'tests/ui/autoref-autoderef/auto-ref.rs')
-rw-r--r-- | tests/ui/autoref-autoderef/auto-ref.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/autoref-autoderef/auto-ref.rs b/tests/ui/autoref-autoderef/auto-ref.rs new file mode 100644 index 000000000..b77f9c342 --- /dev/null +++ b/tests/ui/autoref-autoderef/auto-ref.rs @@ -0,0 +1,19 @@ +// run-pass +struct Foo { + x: isize, +} + +trait Stuff { + fn printme(&self); +} + +impl Stuff for Foo { + fn printme(&self) { + println!("{}", self.x); + } +} + +pub fn main() { + let x = Foo { x: 3 }; + x.printme(); +} |