summaryrefslogtreecommitdiffstats
path: root/tests/ui/deriving/deriving-eq-ord-boxed-slice.rs
blob: 5b4b09836230c633da0a2110ab7a8a22adc79b65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// 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);
}