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-06 06:58:43 +08:00
}
impl Animal for Cat {
//~^ ERROR not all trait items implemented, missing: `eat`
2012-09-11 09:00:03 +08:00
}
fn cat(in_x : usize) -> Cat {
Cat {
2012-09-06 06:58:43 +08:00
meows: in_x
}
}
fn main() {
let nyan = cat(0);
}