about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--compiler/rustc_parse/src/parser/stmt.rs4
-rw-r--r--tests/ui/proc-macro/raw-ident.stderr4
2 files changed, 4 insertions, 4 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),
diff --git a/tests/ui/proc-macro/raw-ident.stderr b/tests/ui/proc-macro/raw-ident.stderr
index 32b36c6d989..a72067021cb 100644
--- a/tests/ui/proc-macro/raw-ident.stderr
+++ b/tests/ui/proc-macro/raw-ident.stderr
@@ -5,10 +5,6 @@ LL |     make_bad_struct!(S);
    |     ^^^^^^^^^^^^^^^^^^^ expected one of 8 possible tokens
    |
    = note: this error originates in the macro `make_bad_struct` (in Nightly builds, run with -Z macro-backtrace for more info)
-help: you might have meant to write a field access
-   |
-LL |     .;
-   |     ~
 
 error: aborting due to 1 previous error