1
Fork 0

Add flag to forbid recovery in the parser

This commit is contained in:
Nilstrieb 2022-10-25 21:24:01 +02:00
parent 85d089b41e
commit ed14202864
No known key found for this signature in database
3 changed files with 24 additions and 2 deletions

View file

@ -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