merge BorrowKind::Unique into BorrowKind::Mut

This commit is contained in:
Ziru Niu 2023-05-31 06:25:27 +08:00
parent 6fc0273b5a
commit 8fb4c41f35
21 changed files with 109 additions and 105 deletions

View file

@ -522,7 +522,7 @@ impl<'tcx> Inliner<'tcx> {
trace!("creating temp for return destination");
let dest = Rvalue::Ref(
self.tcx.lifetimes.re_erased,
BorrowKind::Mut { allow_two_phase_borrow: false },
BorrowKind::Mut { kind: MutBorrowKind::Default },
destination,
);
let dest_ty = dest.ty(caller_body, self.tcx);

View file

@ -188,7 +188,7 @@ fn build_drop_shim<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId, ty: Option<Ty<'tcx>>)
// has been put into the body.
let reborrow = Rvalue::Ref(
tcx.lifetimes.re_erased,
BorrowKind::Mut { allow_two_phase_borrow: false },
BorrowKind::Mut { kind: MutBorrowKind::Default },
tcx.mk_place_deref(dropee_ptr),
);
let ref_ty = reborrow.ty(body.local_decls(), tcx);
@ -712,7 +712,7 @@ fn build_call_shim<'tcx>(
)
.immutable(),
);
let borrow_kind = BorrowKind::Mut { allow_two_phase_borrow: false };
let borrow_kind = BorrowKind::Mut { kind: MutBorrowKind::Default };
statements.push(Statement {
source_info,
kind: StatementKind::Assign(Box::new((