Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 246f1f8

Browse files
committed
Improve recovery on malformed format call
If a comma in a format call is replaced with a similar token, then we emit an error and continue parsing, instead of stopping at this point.
1 parent 282c598 commit 246f1f8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tests/ui/issue-3145.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
fn main() {
2-
println!("{}" a); //~ERROR expected token: `,`
2+
println!("{}" a); //~ERROR expected `,`, found `a`
33
}

tests/ui/issue-3145.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
error: expected token: `,`
1+
error: expected `,`, found `a`
22
--> $DIR/issue-3145.rs:2:19
33
|
4-
LL | println!("{}" a); //~ERROR expected token: `,`
4+
LL | println!("{}" a); //~ERROR expected `,`, found `a`
55
| ^ expected `,`
66

77
error: aborting due to previous error

0 commit comments

Comments
 (0)