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

Commit 365b13c

Browse files
committed
Auto merge of rust-lang#76160 - scileo:format-recovery, r=petrochenkov
Improve recovery on malformed format call The token following a format expression should be a comma. However, when it is replaced with a similar token (such as a dot), then the corresponding error is emitted, but the token is treated as a comma, and the parsing step continues. r? @petrochenkov
2 parents fdc48fb + 246f1f8 commit 365b13c

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)