rust/tests/ui/class-method-missing.rs
2023-01-11 09:32:08 +00:00

21 lines
259 B
Rust

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);
}