about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/expr.rs
diff options
context:
space:
mode:
authorNilstrieb <48135649+Nilstrieb@users.noreply.github.com>2022-10-25 21:24:01 +0200
committerNilstrieb <48135649+Nilstrieb@users.noreply.github.com>2022-10-25 22:06:53 +0200
commited142028641079918b95b539f0570e92469687fe (patch)
tree6e084cde0588b24bb9c1d3e410843828fcfd8e77 /compiler/rustc_parse/src/parser/expr.rs
parent85d089b41e2a0c0f07ab34f6c5a7c451389f25e6 (diff)
downloadrust-ed142028641079918b95b539f0570e92469687fe.tar.gz
rust-ed142028641079918b95b539f0570e92469687fe.zip
Add flag to forbid recovery in the parser
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 ca216b1cd10..a781748efc5 100644
--- a/compiler/rustc_parse/src/parser/expr.rs
+++ b/compiler/rustc_parse/src/parser/expr.rs
@@ -2112,6 +2112,8 @@ impl<'a> Parser<'a> {
             // HACK: This is needed so we can detect whether we're inside a macro,
             // where regular assumptions about what tokens can follow other tokens
             // don't necessarily apply.
+            && self.may_recover()
+            // FIXME(Nilstrieb): Remove this check once `may_recover` actually stops recovery
             && self.subparser_name.is_none()
         {
             // It is likely that the closure body is a block but where the