-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.C-future-incompatibilityCategory: Future-incompatibility lintsCategory: Future-incompatibility lints
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)
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.C-future-incompatibilityCategory: Future-incompatibility lintsCategory: Future-incompatibility lints