about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/expr.rs
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2023-02-03 23:04:51 +0530
committerGitHub <noreply@github.com>2023-02-03 23:04:51 +0530
commit815dc9c48097b4b31dd7d7a90e2fa0188895dc62 (patch)
tree09f441dd2590277d7e87ef4d414b91310d03453c /compiler/rustc_parse/src/parser/expr.rs
parentd9db35785d33e2b6c6e9b4971dfdbe0984a69b9e (diff)
parenta86fc727fa9b9fa1ac60b67147736783b3376e91 (diff)
downloadrust-815dc9c48097b4b31dd7d7a90e2fa0188895dc62.tar.gz
rust-815dc9c48097b4b31dd7d7a90e2fa0188895dc62.zip
Rollup merge of #107544 - nnethercote:improve-TokenCursor, r=petrochenkov
Improve `TokenCursor`.

Some small improvements, for things that were bugging me.

Best reviewed one commit at a time.

r? ``@petrochenkov``
Diffstat (limited to 'compiler/rustc_parse/src/parser/expr.rs')
-rw-r--r--compiler/rustc_parse/src/parser/expr.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs
index 3d42a9dcbbe..8a6436b041b 100644
--- a/compiler/rustc_parse/src/parser/expr.rs
+++ b/compiler/rustc_parse/src/parser/expr.rs
@@ -2141,7 +2141,7 @@ impl<'a> Parser<'a> {
         }
 
         if self.token.kind == TokenKind::Semi
-            && matches!(self.token_cursor.frame.delim_sp, Some((Delimiter::Parenthesis, _)))
+            && matches!(self.token_cursor.stack.last(), Some((_, Delimiter::Parenthesis, _)))
             && self.may_recover()
         {
             // It is likely that the closure body is a block but where the