mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
17 lines
283 B
Rust
17 lines
283 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));
|
|
}
|