rust/src/test/compile-fail/class-method-missing.rs

21 lines
225 B
Rust
Raw Normal View History

// error-pattern:missing method `eat`
trait animal {
fn eat();
}
2012-09-10 20:00:03 -05:00
struct cat {
2012-09-06 21:40:15 -05:00
meows: uint,
2012-09-05 17:58:43 -05:00
}
2012-09-10 20:00:03 -05:00
impl cat : animal {
}
2012-09-05 17:58:43 -05:00
fn cat(in_x : uint) -> cat {
cat {
meows: in_x
}
}
fn main() {
let nyan = cat(0u);
}