rust/tests/ui/deriving/deriving-via-extension-enum.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
283 B
Rust
Raw Normal View History

// run-pass
#![allow(dead_code)]
2015-01-28 13:34:18 +00:00
#[derive(PartialEq, Debug)]
enum Foo {
Bar(isize, isize),
Baz(f64, f64)
}
pub fn main() {
let a = Foo::Bar(1, 2);
let b = Foo::Bar(1, 2);
assert_eq!(a, b);
2013-03-29 01:39:09 +00:00
assert!(!(a != b));
assert!(a.eq(&b));
assert!(!a.ne(&b));
}