mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
Fix ICE #90993
: add missing call to cancel
This commit is contained in:
parent
3d789740b0
commit
77a105c91f
@ -817,7 +817,7 @@ impl<'a> Parser<'a> {
|
|||||||
// Ensure the user doesn't receive unhelpful unexpected token errors
|
// Ensure the user doesn't receive unhelpful unexpected token errors
|
||||||
self.bump();
|
self.bump();
|
||||||
if self.is_pat_range_end_start(0) {
|
if self.is_pat_range_end_start(0) {
|
||||||
let _ = self.parse_pat_range_end();
|
let _ = self.parse_pat_range_end().map_err(|mut e| e.cancel());
|
||||||
}
|
}
|
||||||
|
|
||||||
self.error_inclusive_range_with_extra_equals(span_with_eq);
|
self.error_inclusive_range_with_extra_equals(span_with_eq);
|
||||||
|
6
src/test/ui/parser/issue-90993.rs
Normal file
6
src/test/ui/parser/issue-90993.rs
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
fn main() {
|
||||||
|
...=.
|
||||||
|
//~^ ERROR: unexpected token: `...`
|
||||||
|
//~| ERROR: unexpected `=` after inclusive range
|
||||||
|
//~| ERROR: expected one of `-`, `;`, `}`, or path, found `.`
|
||||||
|
}
|
31
src/test/ui/parser/issue-90993.stderr
Normal file
31
src/test/ui/parser/issue-90993.stderr
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
error: unexpected token: `...`
|
||||||
|
--> $DIR/issue-90993.rs:2:5
|
||||||
|
|
|
||||||
|
LL | ...=.
|
||||||
|
| ^^^
|
||||||
|
|
|
||||||
|
help: use `..` for an exclusive range
|
||||||
|
|
|
||||||
|
LL | ..=.
|
||||||
|
| ~~
|
||||||
|
help: or `..=` for an inclusive range
|
||||||
|
|
|
||||||
|
LL | ..==.
|
||||||
|
| ~~~
|
||||||
|
|
||||||
|
error: unexpected `=` after inclusive range
|
||||||
|
--> $DIR/issue-90993.rs:2:5
|
||||||
|
|
|
||||||
|
LL | ...=.
|
||||||
|
| ^^^^ help: use `..=` instead
|
||||||
|
|
|
||||||
|
= note: inclusive ranges end with a single equals sign (`..=`)
|
||||||
|
|
||||||
|
error: expected one of `-`, `;`, `}`, or path, found `.`
|
||||||
|
--> $DIR/issue-90993.rs:2:9
|
||||||
|
|
|
||||||
|
LL | ...=.
|
||||||
|
| ^ expected one of `-`, `;`, `}`, or path
|
||||||
|
|
||||||
|
error: aborting due to 3 previous errors
|
||||||
|
|
Loading…
Reference in New Issue
Block a user