about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/stmt.rs
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2024-11-16 00:10:48 +0000
committerEsteban Küber <esteban@kuber.com.ar>2024-12-21 02:46:33 +0000
commitcbbc7becc820e05f64d8a23d1a63a27e51b8ff7a (patch)
treeec4dea59fa06072ef2bbb385525f8efbb0d973fe /compiler/rustc_parse/src/parser/stmt.rs
parent1ce0fa98c7766dc9e168b92ff9bc4e0df4fcaaef (diff)
downloadrust-cbbc7becc820e05f64d8a23d1a63a27e51b8ff7a.tar.gz
rust-cbbc7becc820e05f64d8a23d1a63a27e51b8ff7a.zip
Account for missing `.` in macros to avoid incorrect suggestion
Diffstat (limited to 'compiler/rustc_parse/src/parser/stmt.rs')
-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),