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:
parent
ee17c3bc4d
commit
849e0364c1
8 changed files with 107 additions and 99 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue