From f0bbc782ac11de6001eeec63e347427dbc639c04 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Tue, 26 Apr 2022 13:14:38 +1000 Subject: Avoid producing `NoDelim` values in `TokenCursorFrame`. --- compiler/rustc_parse/src/parser/expr.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'compiler/rustc_parse/src/parser/expr.rs') diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index 7efc0ca2da2..e4370809ebc 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -2043,7 +2043,8 @@ impl<'a> Parser<'a> { self.sess.gated_spans.gate(sym::async_closure, span); } - if self.token.kind == TokenKind::Semi && self.token_cursor.frame.delim == DelimToken::Paren + if self.token.kind == TokenKind::Semi + && matches!(self.token_cursor.frame.delim_sp, Some((DelimToken::Paren, _))) { // It is likely that the closure body is a block but where the // braces have been removed. We will recover and eat the next -- cgit 1.4.1-3-g733a5