diff options
| author | Michael Goulet <michael@errs.io> | 2024-10-29 01:34:06 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-10-29 01:34:06 +0000 |
| commit | 599ffab6cd240486fe63d22b01504b24938fc384 (patch) | |
| tree | ad1762c98c2109c18e3eb46d299f795d8d4fee29 /compiler/rustc_mir_build/src | |
| parent | 9f57edf2e261ade3c926d69459162057f15164d6 (diff) | |
| download | rust-599ffab6cd240486fe63d22b01504b24938fc384.tar.gz rust-599ffab6cd240486fe63d22b01504b24938fc384.zip | |
Remove region from adjustments
Diffstat (limited to 'compiler/rustc_mir_build/src')
| -rw-r--r-- | compiler/rustc_mir_build/src/thir/cx/expr.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/rustc_mir_build/src/thir/cx/expr.rs b/compiler/rustc_mir_build/src/thir/cx/expr.rs index e2823456477..7695d149ce2 100644 --- a/compiler/rustc_mir_build/src/thir/cx/expr.rs +++ b/compiler/rustc_mir_build/src/thir/cx/expr.rs @@ -140,7 +140,7 @@ impl<'tcx> Cx<'tcx> { expr = Expr { temp_lifetime, - ty: Ty::new_ref(self.tcx, deref.region, expr.ty, deref.mutbl), + ty: Ty::new_ref(self.tcx, self.tcx.lifetimes.re_erased, expr.ty, deref.mutbl), span, kind: ExprKind::Borrow { borrow_kind: deref.mutbl.to_borrow_kind(), @@ -152,14 +152,14 @@ impl<'tcx> Cx<'tcx> { self.overloaded_place(hir_expr, adjustment.target, Some(call), expr, deref.span) } - Adjust::Borrow(AutoBorrow::Ref(_, m)) => ExprKind::Borrow { + Adjust::Borrow(AutoBorrow::Ref(m)) => ExprKind::Borrow { borrow_kind: m.to_borrow_kind(), arg: self.thir.exprs.push(expr), }, Adjust::Borrow(AutoBorrow::RawPtr(mutability)) => { ExprKind::RawBorrow { mutability, arg: self.thir.exprs.push(expr) } } - Adjust::ReborrowPin(region, mutbl) => { + Adjust::ReborrowPin(mutbl) => { debug!("apply ReborrowPin adjustment"); // Rewrite `$expr` as `Pin { __pointer: &(mut)? *($expr).__pointer }` @@ -197,7 +197,8 @@ impl<'tcx> Cx<'tcx> { hir::Mutability::Mut => BorrowKind::Mut { kind: mir::MutBorrowKind::Default }, hir::Mutability::Not => BorrowKind::Shared, }; - let new_pin_target = Ty::new_ref(self.tcx, region, ptr_target_ty, mutbl); + let new_pin_target = + Ty::new_ref(self.tcx, self.tcx.lifetimes.re_erased, ptr_target_ty, mutbl); let expr = self.thir.exprs.push(Expr { temp_lifetime, ty: new_pin_target, |
