Closed
Description
With the following code (playground):
fn main() {
let x = 42.0;
match x {
5.0 => {}
_ => {}
}
}
I expected to see one warning.
Instead, this happened:
warning: floating-point types cannot be used in patterns
--> src/main.rs:5:9
|
5 | 5.0 => {}
| ^^^
|
= note: `#[warn(illegal_floating_point_literal_pattern)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
warning: floating-point types cannot be used in patterns
--> src/main.rs:5:9
|
5 | 5.0 => {}
| ^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
warning: 2 warnings emitted
Meta
1.55.0-nightly
(2021-06-23 5a7834050f3a0ebcd117)