Move predecessors from Body to BasicBlocks

This commit is contained in:
Tomasz Miąsko 2022-07-05 00:00:00 +00:00
parent 2446b17745
commit 39d9c1cb1f
9 changed files with 10 additions and 16 deletions

View file

@ -1628,7 +1628,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
location: Location,
) -> impl Iterator<Item = Location> + Captures<'tcx> + 'a {
if location.statement_index == 0 {
let predecessors = body.predecessors()[location.block].to_vec();
let predecessors = body.basic_blocks.predecessors()[location.block].to_vec();
Either::Left(predecessors.into_iter().map(move |bb| body.terminator_loc(bb)))
} else {
Either::Right(std::iter::once(Location {