Check for missing space between fat arrow and range pattern
This commit is contained in:
parent
d6f0642827
commit
4bfab39f9b
4 changed files with 59 additions and 14 deletions
|
@ -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 `>`
|
||||
}
|
||||
}
|
|
@ -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
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue