[MIR] Fix the destination of implicit else branch
This commit is contained in:
parent
f50fb159e9
commit
ae151d3945
1 changed files with 1 additions and 1 deletions
|
@ -63,7 +63,7 @@ impl<'a,'tcx> Builder<'a,'tcx> {
|
||||||
} else {
|
} else {
|
||||||
// Body of the `if` expression without an `else` clause must return `()`, thus
|
// Body of the `if` expression without an `else` clause must return `()`, thus
|
||||||
// we implicitly generate a `else {}` if it is not specified.
|
// we implicitly generate a `else {}` if it is not specified.
|
||||||
this.cfg.push_assign_unit(else_block, expr_span, &Lvalue::ReturnPointer);
|
this.cfg.push_assign_unit(else_block, expr_span, destination);
|
||||||
else_block
|
else_block
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue