2016-03-11 12:36:55 -06:00
|
|
|
#[derive(PartialEq)]
|
|
|
|
struct Foo {
|
|
|
|
x: u32
|
|
|
|
}
|
|
|
|
|
|
|
|
const FOO: Foo = Foo { x: 0 };
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let y = Foo { x: 1 };
|
|
|
|
match y {
|
|
|
|
FOO => { }
|
2016-03-25 14:14:45 -05:00
|
|
|
//~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
|
2016-03-11 12:36:55 -06:00
|
|
|
_ => { }
|
|
|
|
}
|
|
|
|
|
|
|
|
let x = 0.0;
|
|
|
|
match x {
|
|
|
|
f32::INFINITY => { }
|
2018-01-16 02:31:48 -06:00
|
|
|
//~^ WARNING floating-point types cannot be used in patterns
|
2019-04-15 14:54:18 -05:00
|
|
|
//~| WARNING this was previously accepted by the compiler but is being phased out
|
2016-03-11 12:36:55 -06:00
|
|
|
_ => { }
|
|
|
|
}
|
|
|
|
}
|