Skip to content

Commit 5bb870f

Browse files
authored
Reintroduce the early returns
1 parent 02fb1b0 commit 5bb870f

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/librustc_mir/transform/inline.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -606,19 +606,24 @@ impl<'a, 'tcx> MutVisitor<'tcx> for Integrator<'a, 'tcx> {
606606
_location: Location) {
607607
if *local == RETURN_POINTER {
608608
match self.destination {
609-
Lvalue::Local(l) => *local = l,
609+
Lvalue::Local(l) => {
610+
*local = l;
611+
return;
612+
},
610613
ref lval => bug!("Return lvalue is {:?}, not local", lval)
611614
}
612615
}
613616
let idx = local.index() - 1;
614617
if idx < self.args.len() {
615618
match self.args[idx] {
616-
Operand::Consume(Lvalue::Local(l)) => *local = l,
619+
Operand::Consume(Lvalue::Local(l)) => {
620+
*local = l;
621+
return;
622+
},
617623
ref op => bug!("Arg operand `{:?}` is {:?}, not local", idx, op)
618624
}
619-
} else {
620-
*local = self.local_map[Local::new(idx - self.args.len())];
621625
}
626+
*local = self.local_map[Local::new(idx - self.args.len())];
622627
}
623628

624629
fn visit_lvalue(&mut self,

0 commit comments

Comments
 (0)