about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/expr.rs
diff options
context:
space:
mode:
authorStuart Cook <Zalathar@users.noreply.github.com>2025-08-09 13:58:54 +1000
committerGitHub <noreply@github.com>2025-08-09 13:58:54 +1000
commitaea608c751238e6d9280658ccfb867c4e135b67c (patch)
treec030e8f7d759eccccd1b6e9d32d1d50584529db5 /compiler/rustc_parse/src/parser/expr.rs
parenta56142cbfbcd9b1506f7f18431de09b15f7adbb3 (diff)
parentb2d524c43d113bba72e0a23b4a97cbbeb6eb39bb (diff)
downloadrust-aea608c751238e6d9280658ccfb867c4e135b67c.tar.gz
rust-aea608c751238e6d9280658ccfb867c4e135b67c.zip
Rollup merge of #145124 - compiler-errors:for-eq, r=lqd
Recover `for PAT = EXPR {}`

I type this constantly, and the existing suggestion to put `in` before the `=` is misleading.
Diffstat (limited to 'compiler/rustc_parse/src/parser/expr.rs')
-rw-r--r--compiler/rustc_parse/src/parser/expr.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs
index 35b987cf50f..cbf6b78431c 100644
--- a/compiler/rustc_parse/src/parser/expr.rs
+++ b/compiler/rustc_parse/src/parser/expr.rs
@@ -3028,6 +3028,8 @@ impl<'a> Parser<'a> {
             let span = self.token.span;
             self.bump();
             (span, errors::MissingInInForLoopSub::InNotOf)
+        } else if self.eat(exp!(Eq)) {
+            (self.prev_token.span, errors::MissingInInForLoopSub::InNotEq)
         } else {
             (self.prev_token.span.between(self.token.span), errors::MissingInInForLoopSub::AddIn)
         };