about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSimonas Kazlauskas <git@kazlauskas.me>2016-02-07 21:47:23 +0200
committerSimonas Kazlauskas <git@kazlauskas.me>2016-02-07 21:47:23 +0200
commitae151d3945e715b7c61ef7b7e5628b915ea320b7 (patch)
treeff5ce993ccb33bf4f3d318406f456fa612aac9dd
parentf50fb159e97eee82b4ff6abaa4003a49d6fe680f (diff)
downloadrust-ae151d3945e715b7c61ef7b7e5628b915ea320b7.tar.gz
rust-ae151d3945e715b7c61ef7b7e5628b915ea320b7.zip
[MIR] Fix the destination of implicit else branch
-rw-r--r--src/librustc_mir/build/expr/into.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc_mir/build/expr/into.rs b/src/librustc_mir/build/expr/into.rs
index f50e5689df0..ca00b99b108 100644
--- a/src/librustc_mir/build/expr/into.rs
+++ b/src/librustc_mir/build/expr/into.rs
@@ -63,7 +63,7 @@ impl<'a,'tcx> Builder<'a,'tcx> {
                 } else {
                     // Body of the `if` expression without an `else` clause must return `()`, thus
                     // 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
                 };