Refactor call terminator to always hold a destination place

This commit is contained in:
Jakob Degen
2022-04-16 09:27:54 -04:00
parent 222c5724ec
commit 09b0936db2
67 changed files with 422 additions and 412 deletions

View File

@@ -450,7 +450,8 @@ impl<'tcx> CloneShimBuilder<'tcx> {
TerminatorKind::Call {
func,
args: vec![Operand::Move(ref_loc)],
destination: Some((dest, next)),
destination: dest,
target: Some(next),
cleanup: Some(cleanup),
from_hir_call: true,
fn_span: self.span,
@@ -676,7 +677,8 @@ fn build_call_shim<'tcx>(
TerminatorKind::Call {
func: callee,
args,
destination: Some((Place::return_place(), BasicBlock::new(1))),
destination: Place::return_place(),
target: Some(BasicBlock::new(1)),
cleanup: if let Some(Adjustment::RefMut) = rcvr_adjustment {
Some(BasicBlock::new(3))
} else {