@@ -582,10 +582,10 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
582582 target_scope : CodeExtent ,
583583 to_index : CFGIndex ) {
584584 let mut data = CFGEdgeData { exiting_scopes : vec ! [ ] } ;
585- let mut scope = CodeExtent :: Misc ( from_expr. id ) ;
585+ let mut scope = CodeExtent :: Misc ( from_expr. hir_id . local_id ) ;
586586 let region_maps = self . tcx . region_maps ( self . owner_def_id ) ;
587587 while scope != target_scope {
588- data. exiting_scopes . push ( self . tcx . hir . node_to_hir_id ( scope. node_id ( ) ) . local_id ) ;
588+ data. exiting_scopes . push ( scope. item_local_id ( ) ) ;
589589 scope = region_maps. encl_scope ( scope) ;
590590 }
591591 self . graph . add_edge ( from_index, to_index, data) ;
@@ -612,7 +612,8 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
612612 hir:: ScopeTarget :: Block ( block_expr_id) => {
613613 for b in & self . breakable_block_scopes {
614614 if b. block_expr_id == self . tcx . hir . node_to_hir_id ( block_expr_id) . local_id {
615- return ( CodeExtent :: Misc ( block_expr_id) , match scope_cf_kind {
615+ let scope_id = self . tcx . hir . node_to_hir_id ( block_expr_id) . local_id ;
616+ return ( CodeExtent :: Misc ( scope_id) , match scope_cf_kind {
616617 ScopeCfKind :: Break => b. break_index ,
617618 ScopeCfKind :: Continue => bug ! ( "can't continue to block" ) ,
618619 } ) ;
@@ -623,7 +624,8 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
623624 hir:: ScopeTarget :: Loop ( hir:: LoopIdResult :: Ok ( loop_id) ) => {
624625 for l in & self . loop_scopes {
625626 if l. loop_id == self . tcx . hir . node_to_hir_id ( loop_id) . local_id {
626- return ( CodeExtent :: Misc ( loop_id) , match scope_cf_kind {
627+ let scope_id = self . tcx . hir . node_to_hir_id ( loop_id) . local_id ;
628+ return ( CodeExtent :: Misc ( scope_id) , match scope_cf_kind {
627629 ScopeCfKind :: Break => l. break_index ,
628630 ScopeCfKind :: Continue => l. continue_index ,
629631 } ) ;
0 commit comments