about summary refs log tree commit diff
path: root/tests/ui/autoref-autoderef/auto-ref.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/autoref-autoderef/auto-ref.rs')
-rw-r--r--tests/ui/autoref-autoderef/auto-ref.rs19
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 00000000000..b77f9c34213
--- /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();
+}