mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-01 03:03:40 +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));
|
|
}
|