about summary refs log tree commit diff
path: root/tests/ui/class-method-missing.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/class-method-missing.rs')
-rw-r--r--tests/ui/class-method-missing.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/ui/class-method-missing.rs b/tests/ui/class-method-missing.rs
new file mode 100644
index 00000000000..5dc18328f31
--- /dev/null
+++ b/tests/ui/class-method-missing.rs
@@ -0,0 +1,21 @@
+trait Animal {
+  fn eat(&self);
+}
+
+struct Cat {
+  meows: usize,
+}
+
+impl Animal for Cat {
+    //~^ ERROR not all trait items implemented, missing: `eat`
+}
+
+fn cat(in_x : usize) -> Cat {
+    Cat {
+        meows: in_x
+    }
+}
+
+fn main() {
+  let nyan = cat(0);
+}