Closed as not planned
Description
rustc version: rustc 1.75.0 (82e1608 2023-12-21)
relevant settings: nothing
Following code reports a warning:
pub fn test() {
let zoom = 2;
let class = "foo";
match (zoom, class) {
(13.., "railway") => {}
(12..=13, "highway") => {}
_ => {}
}
}
warning: multiple patterns overlap on their endpoints
--> src/test.rs:7:8
|
6 | (13.., "railway") => {}
| ---- this range overlaps on `13_i32`...
7 | (12..=13, "highway") => {}
| ^^^^^^^ ... with this range
|
= note: you likely meant to write mutually exclusive ranges
But branches are mutually exclusive because of the second element in the tuple.
The code is a minimal testcase. Original code contains much more branches (ranges, classes, predicates)