rust/src/test/compile-fail/enum-deriving-incomplete.rs

25 lines
344 B
Rust

trait MyEq {
#[derivable]
pure fn eq(&self, other: &self) -> bool;
}
struct A {
x: int
}
enum B {
C(A),
D(A),
E(A)
}
impl B : MyEq;
//~^ ERROR cannot automatically derive
//~^^ ERROR cannot automatically derive
//~^^^ ERROR cannot automatically derive
fn main() {
let c = C(A { x: 15 });
assert c.eq(&c);
}