@@ -102,7 +102,7 @@ use crate::hir::Node;
102
102
use crate :: ty:: { self , TyCtxt } ;
103
103
use crate :: ty:: query:: Providers ;
104
104
use crate :: lint;
105
- use crate :: util:: nodemap:: { NodeMap , HirIdMap , HirIdSet } ;
105
+ use crate :: util:: nodemap:: { HirIdMap , HirIdSet } ;
106
106
107
107
use errors:: Applicability ;
108
108
use std:: collections:: { BTreeMap , VecDeque } ;
@@ -669,8 +669,8 @@ struct Liveness<'a, 'tcx: 'a> {
669
669
// mappings from loop node ID to LiveNode
670
670
// ("break" label should map to loop node ID,
671
671
// 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 > ,
674
674
}
675
675
676
676
impl < ' a , ' tcx > Liveness < ' a , ' tcx > {
@@ -951,8 +951,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
951
951
fn propagate_through_block ( & mut self , blk : & hir:: Block , succ : LiveNode )
952
952
-> LiveNode {
953
953
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) ;
956
955
}
957
956
let succ = self . propagate_through_opt_expr ( blk. expr . as_ref ( ) . map ( |e| & * * e) , succ) ;
958
957
blk. stmts . iter ( ) . rev ( ) . fold ( succ, |succ, stmt| {
@@ -1111,7 +1110,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
1111
1110
hir:: ExprKind :: Break ( label, ref opt_expr) => {
1112
1111
// Find which label this break jumps to
1113
1112
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 ) ,
1115
1114
Err ( err) => span_bug ! ( expr. span, "loop scope error: {}" , err) ,
1116
1115
} . cloned ( ) ;
1117
1116
@@ -1390,15 +1389,14 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
1390
1389
debug ! ( "propagate_through_loop: using id for loop body {} {}" ,
1391
1390
expr. hir_id, self . ir. tcx. hir( ) . hir_to_pretty_string( body. hir_id) ) ;
1392
1391
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) ;
1395
1393
1396
1394
let cond_ln = match kind {
1397
1395
LoopLoop => ln,
1398
1396
WhileLoop ( ref cond) => self . propagate_through_expr ( & cond, ln) ,
1399
1397
} ;
1400
1398
1401
- self . cont_ln . insert ( node_id , cond_ln) ;
1399
+ self . cont_ln . insert ( expr . hir_id , cond_ln) ;
1402
1400
1403
1401
let body_ln = self . propagate_through_block ( body, cond_ln) ;
1404
1402
0 commit comments