From b7b67228f9cd4fab4462ebe4d4d05ad10bf5a7d7 Mon Sep 17 00:00:00 2001 From: Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> Date: Sat, 12 Nov 2022 22:12:33 +0100 Subject: Only do parser recovery on retried macro matching This prevents issues with eager parser recovery during macro matching. --- compiler/rustc_parse/src/parser/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'compiler/rustc_parse/src/parser') diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs index 14dc490fb02..13a38a17735 100644 --- a/compiler/rustc_parse/src/parser/mod.rs +++ b/compiler/rustc_parse/src/parser/mod.rs @@ -503,8 +503,8 @@ impl<'a> Parser<'a> { parser } - pub fn forbid_recovery(mut self) -> Self { - self.recovery = Recovery::Forbidden; + pub fn recovery(mut self, recovery: Recovery) -> Self { + self.recovery = recovery; self } -- cgit 1.4.1-3-g733a5