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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
259 B
Rust
Raw Normal View History

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