summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/expr.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2025-05-27 02:32:22 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2025-05-27 13:29:24 +1000
commit991c91fdaa5862835799abfd9c2349e06277097e (patch)
treeb9f20eadb3f2ccd0ec50e3800ed983824a6a9ce1 /compiler/rustc_parse/src/parser/expr.rs
parentc42d1fc2c6ea5a35d8d74f909a1f69dee5d9ce56 (diff)
downloadrust-991c91fdaa5862835799abfd9c2349e06277097e.tar.gz
rust-991c91fdaa5862835799abfd9c2349e06277097e.zip
Reduce `P<T>` to a typedef of `Box<T>`.
Keep the `P` constructor function for now, to minimize immediate churn.

All the `into_inner` calls are removed, which is nice.
Diffstat (limited to 'compiler/rustc_parse/src/parser/expr.rs')
-rw-r--r--compiler/rustc_parse/src/parser/expr.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs
index 6e134bad7bd..5824c2aa405 100644
--- a/compiler/rustc_parse/src/parser/expr.rs
+++ b/compiler/rustc_parse/src/parser/expr.rs
@@ -3450,10 +3450,8 @@ impl<'a> Parser<'a> {
                 // Detect and recover from `($pat if $cond) => $arm`.
                 // FIXME(guard_patterns): convert this to a normal guard instead
                 let span = pat.span;
-                let ast::PatKind::Paren(subpat) = pat.into_inner().kind else { unreachable!() };
-                let ast::PatKind::Guard(_, mut cond) = subpat.into_inner().kind else {
-                    unreachable!()
-                };
+                let ast::PatKind::Paren(subpat) = pat.kind else { unreachable!() };
+                let ast::PatKind::Guard(_, mut cond) = subpat.kind else { unreachable!() };
                 self.psess.gated_spans.ungate_last(sym::guard_patterns, cond.span);
                 CondChecker::new(self, LetChainsPolicy::AlwaysAllowed).visit_expr(&mut cond);
                 let right = self.prev_token.span;