rust/tests/ui/deriving/deriving-via-extension-enum.rs
2024-02-16 20:02:50 +00:00

17 lines
284 B
Rust

//@ run-pass
#![allow(dead_code)]
#[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);
assert!(!(a != b));
assert!(a.eq(&b));
assert!(!a.ne(&b));
}