diff options
Diffstat (limited to 'tests/ui/class-method-missing.rs')
-rw-r--r-- | tests/ui/class-method-missing.rs | 21 |
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 000000000..5dc18328f --- /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); +} |