Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
572 B
Rust
Raw Normal View History

2016-10-27 00:38:18 +03:00
// Matching against NaN should result in a warning
#![allow(unused)]
2018-01-16 09:31:48 +01:00
#![deny(illegal_floating_point_literal_pattern)]
const NAN: f64 = f64::NAN;
2016-10-27 00:38:18 +03:00
fn main() {
let x = NAN;
match x {
2018-01-16 09:31:48 +01:00
NAN => {}, //~ ERROR floating-point types cannot be used
//~| WARN this was previously accepted by the compiler but is being phased out
2016-10-27 00:38:18 +03:00
_ => {},
};
match [x, 1.0] {
2018-01-16 09:31:48 +01:00
[NAN, _] => {}, //~ ERROR floating-point types cannot be used
2020-01-08 20:02:10 +03:00
//~| WARN this was previously accepted by the compiler but is being phased out
2016-10-27 00:38:18 +03:00
_ => {},
};
}