about summary refs log tree commit diff
path: root/tests/ui/self/class-missing-self.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/self/class-missing-self.rs')
-rw-r--r--tests/ui/self/class-missing-self.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/self/class-missing-self.rs b/tests/ui/self/class-missing-self.rs
new file mode 100644
index 00000000000..8ad347d20e6
--- /dev/null
+++ b/tests/ui/self/class-missing-self.rs
@@ -0,0 +1,16 @@
+struct Cat {
+  meows : usize,
+}
+
+impl Cat {
+    fn sleep(&self) { loop{} }
+    fn meow(&self) {
+      println!("Meow");
+      meows += 1; //~ ERROR cannot find value `meows` in this scope
+      sleep();     //~ ERROR cannot find function `sleep` in this
+    }
+
+}
+
+
+ fn main() { }