about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/stmt.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-06-13 23:36:51 +0000
committerbors <bors@rust-lang.org>2022-06-13 23:36:51 +0000
commit3bdec3c8abdc48e46715d7b14b764af28da1cee3 (patch)
treeb72fb84b835e64cc9e6de4c5fc71491b96711fb0 /compiler/rustc_parse/src/parser/stmt.rs
parentca122c7ebb3ab50149c9d3d24ddb59c252b32272 (diff)
parentaa71be1b39d7b672414c622093e906e81aa06351 (diff)
downloadrust-3bdec3c8abdc48e46715d7b14b764af28da1cee3.tar.gz
rust-3bdec3c8abdc48e46715d7b14b764af28da1cee3.zip
Auto merge of #98075 - JohnTitor:rollup-nqwodnk, r=JohnTitor
Rollup of 4 pull requests

Successful merges:

 - #95211 (Improve parser diagnostics)
 - #95243 (Add Apple WatchOS compile targets)
 - #97385 (Add WIP stable MIR crate)
 - #97508 (Harden bad placeholder checks on statics/consts)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_parse/src/parser/stmt.rs')
-rw-r--r--compiler/rustc_parse/src/parser/stmt.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/stmt.rs b/compiler/rustc_parse/src/parser/stmt.rs
index ad0128cd9ed..42355dd93a7 100644
--- a/compiler/rustc_parse/src/parser/stmt.rs
+++ b/compiler/rustc_parse/src/parser/stmt.rs
@@ -260,7 +260,10 @@ impl<'a> Parser<'a> {
                     if let Ok(snip) = self.span_to_snippet(pat.span) {
                         err.span_label(pat.span, format!("while parsing the type for `{}`", snip));
                     }
-                    let err = if self.check(&token::Eq) {
+                    // we use noexpect here because we don't actually expect Eq to be here
+                    // but we are still checking for it in order to be able to handle it if
+                    // it is there
+                    let err = if self.check_noexpect(&token::Eq) {
                         err.emit();
                         None
                     } else {