about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/mod.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2025-02-21 16:47:07 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2025-02-21 16:48:01 +1100
commit0f490b040af82820e423a7e71e0e2e1f6ca7ab57 (patch)
tree51e1a0678df173a482e283e176903ea3d3a0006e /compiler/rustc_parse/src/parser/mod.rs
parent76b04437be91069260c72a6d59d130a4e127a9a8 (diff)
downloadrust-0f490b040af82820e423a7e71e0e2e1f6ca7ab57.tar.gz
rust-0f490b040af82820e423a7e71e0e2e1f6ca7ab57.zip
Avoid snapshotting the parser in `parse_path_inner`.
Diffstat (limited to 'compiler/rustc_parse/src/parser/mod.rs')
-rw-r--r--compiler/rustc_parse/src/parser/mod.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs
index 4b26100c46d..bbd73dec2e4 100644
--- a/compiler/rustc_parse/src/parser/mod.rs
+++ b/compiler/rustc_parse/src/parser/mod.rs
@@ -117,14 +117,13 @@ macro_rules! maybe_recover_from_interpolated_ty_qpath {
     ($self: expr, $allow_qpath_recovery: expr) => {
         if $allow_qpath_recovery
             && $self.may_recover()
-            && let Some(token::MetaVarKind::Ty) = $self.token.is_metavar_seq()
+            && let Some(mv_kind) = $self.token.is_metavar_seq()
+            && let token::MetaVarKind::Ty { .. } = mv_kind
             && $self.check_noexpect_past_close_delim(&token::PathSep)
         {
             // Reparse the type, then move to recovery.
             let ty = $self
-                .eat_metavar_seq(token::MetaVarKind::Ty, |this| {
-                    this.parse_ty_no_question_mark_recover()
-                })
+                .eat_metavar_seq(mv_kind, |this| this.parse_ty_no_question_mark_recover())
                 .expect("metavar seq ty");
 
             return $self.maybe_recover_from_bad_qpath_stage_2($self.prev_token.span, ty);