Auto merge of #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
This commit is contained in:
commit
365b13c0e7
@ -1,3 +1,3 @@
|
||||
fn main() {
|
||||
println!("{}" a); //~ERROR expected token: `,`
|
||||
println!("{}" a); //~ERROR expected `,`, found `a`
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
error: expected token: `,`
|
||||
error: expected `,`, found `a`
|
||||
--> $DIR/issue-3145.rs:2:19
|
||||
|
|
||||
LL | println!("{}" a); //~ERROR expected token: `,`
|
||||
LL | println!("{}" a); //~ERROR expected `,`, found `a`
|
||||
| ^ expected `,`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
Loading…
Reference in New Issue
Block a user