2016-03-11 18:36:55 +00: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 19:14:45 +00:00
|
|
|
//~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
|
2016-03-11 18:36:55 +00:00
|
|
|
_ => { }
|
|
|
|
}
|
|
|
|
|
|
|
|
let x = 0.0;
|
|
|
|
match x {
|
|
|
|
f32::INFINITY => { }
|
2018-01-16 08:31:48 +00:00
|
|
|
//~^ WARNING floating-point types cannot be used in patterns
|
2019-04-15 19:54:18 +00:00
|
|
|
//~| WARNING this was previously accepted by the compiler but is being phased out
|
2016-03-11 18:36:55 +00:00
|
|
|
_ => { }
|
|
|
|
}
|
|
|
|
}
|