1
Fork 0

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

@ -141,7 +141,8 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
TerminatorKind::Call {
func: exchange_malloc,
args: vec![Operand::Move(size), Operand::Move(align)],
destination: Some((storage, success)),
destination: storage,
target: Some(success),
cleanup: None,
from_hir_call: false,
fn_span: expr_span,

View file

@ -255,18 +255,19 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
func: fun,
args,
cleanup: None,
destination,
// The presence or absence of a return edge affects control-flow sensitive
// MIR checks and ultimately whether code is accepted or not. We can only
// omit the return edge if a return type is visibly uninhabited to a module
// that makes the call.
destination: if this.tcx.is_ty_uninhabited_from(
target: if this.tcx.is_ty_uninhabited_from(
this.parent_module,
expr.ty,
this.param_env,
) {
None
} else {
Some((destination, success))
Some(success)
},
from_hir_call,
fn_span,

View file

@ -444,7 +444,8 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
literal: method,
})),
args: vec![val, expect],
destination: Some((eq_result, eq_block)),
destination: eq_result,
target: Some(eq_block),
cleanup: None,
from_hir_call: false,
fn_span: source_info.span,