@@ -582,10 +582,10 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
582
582
target_scope : CodeExtent ,
583
583
to_index : CFGIndex ) {
584
584
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 ) ;
586
586
let region_maps = self . tcx . region_maps ( self . owner_def_id ) ;
587
587
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 ( ) ) ;
589
589
scope = region_maps. encl_scope ( scope) ;
590
590
}
591
591
self . graph . add_edge ( from_index, to_index, data) ;
@@ -612,7 +612,8 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
612
612
hir:: ScopeTarget :: Block ( block_expr_id) => {
613
613
for b in & self . breakable_block_scopes {
614
614
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 {
616
617
ScopeCfKind :: Break => b. break_index ,
617
618
ScopeCfKind :: Continue => bug ! ( "can't continue to block" ) ,
618
619
} ) ;
@@ -623,7 +624,8 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
623
624
hir:: ScopeTarget :: Loop ( hir:: LoopIdResult :: Ok ( loop_id) ) => {
624
625
for l in & self . loop_scopes {
625
626
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 {
627
629
ScopeCfKind :: Break => l. break_index ,
628
630
ScopeCfKind :: Continue => l. continue_index ,
629
631
} ) ;
0 commit comments