@@ -34,8 +34,8 @@ impl<'tcx> crate::MirPass<'tcx> for RemoveNoopLandingPads {
3434
3535        // This is a post-order traversal, so that if A post-dominates B 
3636        // then A will be visited before B. 
37-         for  & bb  in  body . basic_blocks . reverse_postorder ( ) . iter ( ) . rev ( )  { 
38-             let  is_nop_landing_pad = self . is_nop_landing_pad ( bb ,  body ,  & nop_landing_pads) ; 
37+         for  ( bb ,  bbdata )   in  traversal :: postorder ( body )  { 
38+             let  is_nop_landing_pad = self . is_nop_landing_pad ( bbdata ,  & nop_landing_pads) ; 
3939            debug ! ( "is_nop_landing_pad({bb:?}) = {is_nop_landing_pad}" ) ; 
4040            if  is_nop_landing_pad { 
4141                nop_landing_pads. insert ( bb) ; 
@@ -85,11 +85,10 @@ impl<'tcx> crate::MirPass<'tcx> for RemoveNoopLandingPads {
8585impl  RemoveNoopLandingPads  { 
8686    fn  is_nop_landing_pad ( 
8787        & self , 
88-         bb :  BasicBlock , 
89-         body :  & Body < ' _ > , 
88+         bbdata :  & BasicBlockData < ' _ > , 
9089        nop_landing_pads :  & DenseBitSet < BasicBlock > , 
9190    )  -> bool  { 
92-         for  stmt in  & body [ bb ] . statements  { 
91+         for  stmt in  & bbdata . statements  { 
9392            match  & stmt. kind  { 
9493                StatementKind :: FakeRead ( ..) 
9594                | StatementKind :: StorageLive ( _) 
@@ -122,7 +121,7 @@ impl RemoveNoopLandingPads {
122121            } 
123122        } 
124123
125-         let  terminator = body [ bb ] . terminator ( ) ; 
124+         let  terminator = bbdata . terminator ( ) ; 
126125        match  terminator. kind  { 
127126            TerminatorKind :: Goto  {  .. } 
128127            | TerminatorKind :: UnwindResume 
0 commit comments