rust/tests/ui/class-method-missing.rs

22 lines
259 B
Rust
Raw Normal View History

trait Animal {
fn eat(&self);
}
struct Cat {
meows: usize,
2012-09-05 22:58:43 +00:00
}
impl Animal for Cat {
//~^ ERROR not all trait items implemented, missing: `eat`
2012-09-11 01:00:03 +00:00
}
fn cat(in_x : usize) -> Cat {
Cat {
2012-09-05 22:58:43 +00:00
meows: in_x
}
}
fn main() {
let nyan = cat(0);
}