forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cancel parsing ever made during recovery
- Loading branch information
Showing
3 changed files
with
27 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
tests/ui/parser/recover/recover-colon-instead-of-eq-in-local.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
#![allow(unused)] | ||
|
||
fn test_122112() { | ||
// Make sure we don't ICE if parsing in recovery fails | ||
let _: std::env::temp_dir().join(&self, push: Box<usize>); //~ ERROR expected one of | ||
} | ||
|
||
fn main() { | ||
let _: std::env::temp_dir().join("foo"); //~ ERROR expected one of | ||
} |
12 changes: 10 additions & 2 deletions
12
tests/ui/parser/recover/recover-colon-instead-of-eq-in-local.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
error: expected one of `!`, `+`, `->`, `::`, `;`, or `=`, found `.` | ||
--> $DIR/recover-colon-instead-of-eq-in-local.rs:2:32 | ||
--> $DIR/recover-colon-instead-of-eq-in-local.rs:5:32 | ||
| | ||
LL | let _: std::env::temp_dir().join(&self, push: Box<usize>); | ||
| - ^ expected one of `!`, `+`, `->`, `::`, `;`, or `=` | ||
| | | ||
| while parsing the type for `_` | ||
|
||
error: expected one of `!`, `+`, `->`, `::`, `;`, or `=`, found `.` | ||
--> $DIR/recover-colon-instead-of-eq-in-local.rs:9:32 | ||
| | ||
LL | let _: std::env::temp_dir().join("foo"); | ||
| - ^ expected one of `!`, `+`, `->`, `::`, `;`, or `=` | ||
| | | ||
| while parsing the type for `_` | ||
| help: use `=` if you meant to assign | ||
|
||
error: aborting due to 1 previous error | ||
error: aborting due to 2 previous errors | ||
|