1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
// run-pass #![allow(dead_code)] #[derive(PartialEq, Debug)] enum Foo { Bar, Baz, Boo } pub fn main() { let a = Foo::Bar; let b = Foo::Bar; assert_eq!(a, b); assert!(!(a != b)); assert!(a.eq(&b)); assert!(!a.ne(&b)); }