librustc: Forbid .. in range patterns.
This breaks code that looks like:
match foo {
1..3 => { ... }
}
Instead, write:
match foo {
1...3 => { ... }
}
Closes #17295.
[breaking-change]
This commit is contained in:
@@ -9,10 +9,10 @@
|
||||
// except according to those terms.
|
||||
|
||||
|
||||
fn func((1, (Some(1), 2..3)): (int, (Option<int>, int))) { }
|
||||
fn func((1, (Some(1), 2...3)): (int, (Option<int>, int))) { }
|
||||
//~^ ERROR refutable pattern in function argument: `(_, _)` not covered
|
||||
|
||||
fn main() {
|
||||
let (1i, (Some(1i), 2i..3i)) = (1i, (None, 2i));
|
||||
let (1i, (Some(1i), 2i...3i)) = (1i, (None, 2i));
|
||||
//~^ ERROR refutable pattern in local binding: `(_, _)` not covered
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user