Skip to content

Commit

Permalink
Fix incorrect semicolon suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Oct 24, 2018
1 parent ad144ac commit f8818cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/libsyntax/ext/expand.rs
Expand Up @@ -1044,7 +1044,9 @@ impl<'a> Parser<'a> {
);
err.note(&msg);
let semi_span = self.sess.source_map().next_point(span);
match self.sess.source_map().span_to_snippet(semi_span) {

let semi_full_span = semi_span.to(self.sess.source_map().next_point(semi_span));
match self.sess.source_map().span_to_snippet(semi_full_span) {
Ok(ref snippet) if &snippet[..] != ";" && kind_name == "expression" => {
err.span_suggestion_with_applicability(
semi_span,
Expand Down
4 changes: 1 addition & 3 deletions src/test/ui/macros/macro-context.stderr
Expand Up @@ -16,9 +16,7 @@ LL | () => ( i ; typeof ); //~ ERROR expected expression, found reserved k
| ^^^^^^
...
LL | let i = m!();
| ----- help: you might be missing a semicolon here: `;`
| |
| caused by the macro expansion here
| ---- caused by the macro expansion here
|
= note: the usage of `m!` is likely invalid in expression context

Expand Down

0 comments on commit f8818cb

Please sign in to comment.