about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_parse/src/parser')
-rw-r--r--compiler/rustc_parse/src/parser/stmt.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_parse/src/parser/stmt.rs b/compiler/rustc_parse/src/parser/stmt.rs
index 259bc3dcd36..30a150db728 100644
--- a/compiler/rustc_parse/src/parser/stmt.rs
+++ b/compiler/rustc_parse/src/parser/stmt.rs
@@ -763,6 +763,10 @@ impl<'a> Parser<'a> {
         } else {
             return;
         }
+        if self.token.span == self.prev_token.span {
+            // Account for syntax errors in proc-macros.
+            return;
+        }
         if self.look_ahead(1, |t| [token::Semi, token::Question, token::Dot].contains(&t.kind)) {
             err.span_suggestion_verbose(
                 self.prev_token.span.between(self.token.span),