Change Successors to impl Iterator<Item = BasicBlock>

This commit is contained in:
SparrowLii 2022-05-17 08:41:01 +08:00
parent 56d540e057
commit 38bf1158bd
18 changed files with 54 additions and 55 deletions

View file

@ -199,7 +199,7 @@ impl<'tcx> OutOfScopePrecomputer<'_, 'tcx> {
// Add successor BBs to the work list, if necessary.
let bb_data = &self.body[bb];
debug_assert!(hi == bb_data.statements.len());
for &succ_bb in bb_data.terminator().successors() {
for succ_bb in bb_data.terminator().successors() {
if !self.visited.insert(succ_bb) {
if succ_bb == location.block && first_lo > 0 {
// `succ_bb` has been seen before. If it wasn't