From 246f1f8a8eccf4d997e85ed80097f9263624c4a4 Mon Sep 17 00:00:00 2001 From: Sasha Date: Mon, 31 Aug 2020 11:45:50 +0200 Subject: [PATCH] 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. --- tests/ui/issue-3145.rs | 2 +- tests/ui/issue-3145.stderr | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/ui/issue-3145.rs b/tests/ui/issue-3145.rs index f497d5550af..586d13647d1 100644 --- a/tests/ui/issue-3145.rs +++ b/tests/ui/issue-3145.rs @@ -1,3 +1,3 @@ fn main() { - println!("{}" a); //~ERROR expected token: `,` + println!("{}" a); //~ERROR expected `,`, found `a` } diff --git a/tests/ui/issue-3145.stderr b/tests/ui/issue-3145.stderr index cb0d95f5e26..a35032aa150 100644 --- a/tests/ui/issue-3145.stderr +++ b/tests/ui/issue-3145.stderr @@ -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