about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMark Simulacrum <mark.simulacrum@gmail.com>2017-09-06 18:28:07 -0600
committerGitHub <noreply@github.com>2017-09-06 18:28:07 -0600
commit435a5cdc6b9ef49874814aa6f90769e44cee35b7 (patch)
tree3d3a3c6a96b16b9a3666bcc9f12b9be2ee112cd2 /src
parentf8b7c3e1db93e20e3a778ce959552dfe6d908bab (diff)
parent5bb870faca71bd139c5c4a00381974f66f29e859 (diff)
downloadrust-435a5cdc6b9ef49874814aa6f90769e44cee35b7.tar.gz
rust-435a5cdc6b9ef49874814aa6f90769e44cee35b7.zip
Rollup merge of #44362 - oli-obk:patch-7, r=eddyb
Fix a bug in the inliner

r? @eddyb
Diffstat (limited to 'src')
-rw-r--r--src/librustc_mir/transform/inline.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/librustc_mir/transform/inline.rs b/src/librustc_mir/transform/inline.rs
index 3f8070fb3aa..b2572b2d0ab 100644
--- a/src/librustc_mir/transform/inline.rs
+++ b/src/librustc_mir/transform/inline.rs
@@ -606,14 +606,20 @@ impl<'a, 'tcx> MutVisitor<'tcx> for Integrator<'a, 'tcx> {
                    _location: Location) {
         if *local == RETURN_POINTER {
             match self.destination {
-                Lvalue::Local(l) => *local = l,
+                Lvalue::Local(l) => {
+                    *local = l;
+                    return;
+                },
                 ref lval => bug!("Return lvalue is {:?}, not local", lval)
             }
         }
         let idx = local.index() - 1;
         if idx < self.args.len() {
             match self.args[idx] {
-                Operand::Consume(Lvalue::Local(l)) => *local = l,
+                Operand::Consume(Lvalue::Local(l)) => {
+                    *local = l;
+                    return;
+                },
                 ref op => bug!("Arg operand `{:?}` is {:?}, not local", idx, op)
             }
         }