1
Fork 0

Check for missing space between fat arrow and range pattern

This commit is contained in:
clubby789 2023-01-28 20:02:00 +00:00
parent d6f0642827
commit 4bfab39f9b
4 changed files with 59 additions and 14 deletions

View file

@ -0,0 +1,8 @@
fn main() {
let x = 42;
match x {
0..=73 => {},
74..=> {}, //~ ERROR unexpected `=>` after open range
//~^ ERROR expected one of `=>`, `if`, or `|`, found `>`
}
}

View file

@ -0,0 +1,19 @@
error: unexpected `=>` after open range
--> $DIR/half-open-range-pats-inclusive-match-arrow.rs:5:11
|
LL | 74..=> {},
| ^^^
|
help: add a space between the pattern and `=>`
|
LL | 74.. => {},
| +
error: expected one of `=>`, `if`, or `|`, found `>`
--> $DIR/half-open-range-pats-inclusive-match-arrow.rs:5:14
|
LL | 74..=> {},
| ^ expected one of `=>`, `if`, or `|`
error: aborting due to 2 previous errors