rust/src/test/run-pass/deriving-via-extension-struct-like-enum-variant.rs
2013-10-06 14:39:25 -07:00

14 lines
183 B
Rust

#[feature(struct_variant)];
#[deriving(Eq)]
enum S {
X { x: int, y: int },
Y
}
pub fn main() {
let x = X { x: 1, y: 2 };
assert_eq!(x, x);
assert!(!(x != x));
}