1
Fork 0

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.
This commit is contained in:
Zalathar 2025-02-02 17:15:46 +11:00
parent ee17c3bc4d
commit 849e0364c1
8 changed files with 107 additions and 99 deletions

View file

@ -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,