Skip to content

Commit ae151d3

Browse files
committed
[MIR] Fix the destination of implicit else branch
1 parent f50fb15 commit ae151d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc_mir/build/expr/into.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl<'a,'tcx> Builder<'a,'tcx> {
6363
} else {
6464
// Body of the `if` expression without an `else` clause must return `()`, thus
6565
// we implicitly generate a `else {}` if it is not specified.
66-
this.cfg.push_assign_unit(else_block, expr_span, &Lvalue::ReturnPointer);
66+
this.cfg.push_assign_unit(else_block, expr_span, destination);
6767
else_block
6868
};
6969

0 commit comments

Comments
 (0)