Closed
Description
This is a tracking issue for the compatibility lint disallowing floating point literals in patterns.
The corresponding RFC is RFC 1445. Originally, #36890 was the only tracking issue for floats in patterns, but after it was found out that the implementation of that lint doesn't cover literals (issue #41255), another lint and tracking issue were required.
The goal of this lint is to make code like this a hard error:
fn main() {
let x = 13.4;
match x {
1.0 => println!("one"),
22.4 => println!("two"),
3.67 => println!("three"),
13.4 => println!("thirteen point four"),
_ => println!("anything"),
}
}
- PR Implement the illegal_floating_point_literal_pattern compat lint #41293 introduces the lint as warn by default
- PR xxxx makes the lint deny by default
- PR xxxx makes the lint a hard error
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Idea