]> git.lizzy.rs Git - rust.git/blob - src/test/ui/pattern/usefulness/floats.rs
Rollup merge of #79293 - Havvy:test-eval-order-compound-assign, r=Mark-Simulacrum
[rust.git] / src / test / ui / pattern / usefulness / floats.rs
1 #![allow(illegal_floating_point_literal_pattern)]
2 #![deny(unreachable_patterns)]
3
4 fn main() {
5     match 0.0 {
6       0.0..=1.0 => {}
7       _ => {} // ok
8     }
9
10     match 0.0 { //~ ERROR non-exhaustive patterns
11       0.0..=1.0 => {}
12     }
13
14     match 1.0f64 {
15       0.01f64 ..= 6.5f64 => {}
16       0.02f64 => {} //~ ERROR unreachable pattern
17       _ => {}
18     };
19 }