Improve diagnostic for missing space in range pattern
This commit is contained in:
parent
a9985cf172
commit
4ab75de934
6 changed files with 24 additions and 21 deletions
|
@ -2717,6 +2717,14 @@ impl<'a> Parser<'a> {
|
|||
);
|
||||
err.emit();
|
||||
this.bump();
|
||||
} else if matches!(
|
||||
(&this.prev_token.kind, &this.token.kind),
|
||||
(token::DotDotEq, token::Gt)
|
||||
) {
|
||||
// `error_inclusive_range_match_arrow` handles cases like `0..=> {}`,
|
||||
// so we supress the error here
|
||||
err.delay_as_bug();
|
||||
this.bump();
|
||||
} else {
|
||||
return Err(err);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue