Skip to content

Commit

Permalink
Remove redundant backtick in error message.
Browse files Browse the repository at this point in the history
The value passed in already has backticks surrounding the text.
  • Loading branch information
ehuss committed May 16, 2020
1 parent ed084b0 commit 004f4f3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/librustc_parse/parser/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ impl<'a> Parser<'a> {
return Ok(());
}
let sm = self.sess.source_map();
let msg = format!("expected `;`, found `{}`", super::token_descr(&self.token));
let msg = format!("expected `;`, found {}", super::token_descr(&self.token));
let appl = Applicability::MachineApplicable;
if self.token.span == DUMMY_SP || self.prev_token.span == DUMMY_SP {
// Likely inside a macro, can't provide meaningful suggestions.
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/parser/issue-3036.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error: expected `;`, found ``}``
error: expected `;`, found `}`
--> $DIR/issue-3036.rs:5:14
|
LL | let x = 3
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/parser/recover-missing-semi.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error: expected `;`, found `keyword `let``
error: expected `;`, found keyword `let`
--> $DIR/recover-missing-semi.rs:2:22
|
LL | let _: usize = ()
Expand All @@ -7,7 +7,7 @@ LL | let _: usize = ()
LL | let _ = 3;
| --- unexpected token

error: expected `;`, found `keyword `return``
error: expected `;`, found keyword `return`
--> $DIR/recover-missing-semi.rs:9:22
|
LL | let _: usize = ()
Expand Down

0 comments on commit 004f4f3

Please sign in to comment.