about summary refs log tree commit diff
path: root/compiler/rustc_ty_utils/src/consts.rs
diff options
context:
space:
mode:
authorZalathar <Zalathar@users.noreply.github.com>2025-02-02 17:15:46 +1100
committerZalathar <Zalathar@users.noreply.github.com>2025-02-03 16:20:53 +1100
commit849e0364c19931d775ef7bb06af7730cfd601465 (patch)
treebef106976f4f19453fc91eebb65bf39c03a8e344 /compiler/rustc_ty_utils/src/consts.rs
parentee17c3bc4d326a12e2339812a40e6cc5316a1b57 (diff)
downloadrust-849e0364c19931d775ef7bb06af7730cfd601465.tar.gz
rust-849e0364c19931d775ef7bb06af7730cfd601465.zip
Remove `'pat` lifetime from some match-lowering data structures
By storing `PatRange` in an Arc, and copying a few fields out of `Pat`, we can
greatly simplify the lifetimes involved in match lowering.
Diffstat (limited to 'compiler/rustc_ty_utils/src/consts.rs')
-rw-r--r--compiler/rustc_ty_utils/src/consts.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_ty_utils/src/consts.rs b/compiler/rustc_ty_utils/src/consts.rs
index 4038a1d68fa..cbe49d000b7 100644
--- a/compiler/rustc_ty_utils/src/consts.rs
+++ b/compiler/rustc_ty_utils/src/consts.rs
@@ -373,7 +373,8 @@ impl<'a, 'tcx> IsThirPolymorphic<'a, 'tcx> {
 
         match pat.kind {
             thir::PatKind::Constant { value } => value.has_non_region_param(),
-            thir::PatKind::Range(box thir::PatRange { lo, hi, .. }) => {
+            thir::PatKind::Range(ref range) => {
+                let &thir::PatRange { lo, hi, .. } = range.as_ref();
                 lo.has_non_region_param() || hi.has_non_region_param()
             }
             _ => false,