Address nits and remove unneeded pass

This commit is contained in:
Paul Daniel Faria 2019-10-04 09:44:24 -04:00
parent 94414ac7bb
commit 52cc85f008
3 changed files with 4 additions and 8 deletions

View File

@ -496,7 +496,7 @@ fn dest_needs_borrow(place: &Place<'_>) -> bool {
kind: TerminatorKind::Goto { target: BasicBlock::new(bb_len) }
};
caller_body[callsite.bb].terminator= Some(terminator);
caller_body[callsite.bb].terminator = Some(terminator);
true
}

View File

@ -297,8 +297,6 @@ fn run_optimization_passes<'tcx>(
&uniform_array_move_out::RestoreSubsliceArrayMoveOut::new(tcx),
&inline::Inline,
// State transform requires that predecessors have been predefined
&ensure_predecessors_cache::EnsurePredecessorsCache::new("pre-state-transform"),
// Lowering generator control-flow and variables
// has to happen before we do anything else to them.
&generator::StateTransform,

View File

@ -124,11 +124,9 @@ pub fn simplify(mut self) {
changed |= inner_changed;
}
{
let data = &mut self.basic_blocks[bb];
data.statements.extend(new_stmts);
data.terminator = Some(terminator);
}
let data = &mut self.basic_blocks[bb];
data.statements.extend(new_stmts);
data.terminator = Some(terminator);
changed |= inner_changed;
}