@@ -102,7 +102,7 @@ use crate::hir::Node;
102102use crate :: ty:: { self , TyCtxt } ;
103103use crate :: ty:: query:: Providers ;
104104use crate :: lint;
105- use crate :: util:: nodemap:: { NodeMap , HirIdMap , HirIdSet } ;
105+ use crate :: util:: nodemap:: { HirIdMap , HirIdSet } ;
106106
107107use errors:: Applicability ;
108108use std:: collections:: { BTreeMap , VecDeque } ;
@@ -669,8 +669,8 @@ struct Liveness<'a, 'tcx: 'a> {
669669 // mappings from loop node ID to LiveNode
670670 // ("break" label should map to loop node ID,
671671 // it probably doesn't now)
672- break_ln : NodeMap < LiveNode > ,
673- cont_ln : NodeMap < LiveNode > ,
672+ break_ln : HirIdMap < LiveNode > ,
673+ cont_ln : HirIdMap < LiveNode > ,
674674}
675675
676676impl < ' a , ' tcx > Liveness < ' a , ' tcx > {
@@ -951,8 +951,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
951951 fn propagate_through_block ( & mut self , blk : & hir:: Block , succ : LiveNode )
952952 -> LiveNode {
953953 if blk. targeted_by_break {
954- let node_id = self . ir . tcx . hir ( ) . hir_to_node_id ( blk. hir_id ) ;
955- self . break_ln . insert ( node_id, succ) ;
954+ self . break_ln . insert ( blk. hir_id , succ) ;
956955 }
957956 let succ = self . propagate_through_opt_expr ( blk. expr . as_ref ( ) . map ( |e| & * * e) , succ) ;
958957 blk. stmts . iter ( ) . rev ( ) . fold ( succ, |succ, stmt| {
@@ -1111,7 +1110,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
11111110 hir:: ExprKind :: Break ( label, ref opt_expr) => {
11121111 // Find which label this break jumps to
11131112 let target = match label. target_id {
1114- Ok ( node_id ) => self . break_ln . get ( & node_id ) ,
1113+ Ok ( hir_id ) => self . break_ln . get ( & hir_id ) ,
11151114 Err ( err) => span_bug ! ( expr. span, "loop scope error: {}" , err) ,
11161115 } . cloned ( ) ;
11171116
@@ -1390,15 +1389,14 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
13901389 debug ! ( "propagate_through_loop: using id for loop body {} {}" ,
13911390 expr. hir_id, self . ir. tcx. hir( ) . hir_to_pretty_string( body. hir_id) ) ;
13921391
1393- let node_id = self . ir . tcx . hir ( ) . hir_to_node_id ( expr. hir_id ) ;
1394- self . break_ln . insert ( node_id, succ) ;
1392+ self . break_ln . insert ( expr. hir_id , succ) ;
13951393
13961394 let cond_ln = match kind {
13971395 LoopLoop => ln,
13981396 WhileLoop ( ref cond) => self . propagate_through_expr ( & cond, ln) ,
13991397 } ;
14001398
1401- self . cont_ln . insert ( node_id , cond_ln) ;
1399+ self . cont_ln . insert ( expr . hir_id , cond_ln) ;
14021400
14031401 let body_ln = self . propagate_through_block ( body, cond_ln) ;
14041402
0 commit comments