mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
16 lines
368 B
Rust
16 lines
368 B
Rust
//@ run-pass
|
|
#[derive(PartialEq, PartialOrd, Eq, Ord, Debug)]
|
|
struct Foo(Box<[u8]>);
|
|
|
|
pub fn main() {
|
|
let a = Foo(Box::new([0, 1, 2]));
|
|
let b = Foo(Box::new([0, 1, 2]));
|
|
assert_eq!(a, b);
|
|
println!("{}", a != b);
|
|
println!("{}", a < b);
|
|
println!("{}", a <= b);
|
|
println!("{}", a == b);
|
|
println!("{}", a > b);
|
|
println!("{}", a >= b);
|
|
}
|