@@ -13,13 +13,12 @@ use rustc::mir::*;
13
13
use rustc:: mir:: visit:: { MutVisitor , TyContext } ;
14
14
use rustc:: ty:: { self , Ty , TyCtxt } ;
15
15
use rustc:: ty:: subst:: SubstsRef ;
16
- use rustc:: util:: nodemap:: NodeMap ;
16
+ use rustc:: util:: nodemap:: HirIdMap ;
17
17
use rustc_target:: spec:: PanicStrategy ;
18
18
use rustc_data_structures:: indexed_vec:: { IndexVec , Idx } ;
19
19
use std:: mem;
20
20
use std:: u32;
21
21
use rustc_target:: spec:: abi:: Abi ;
22
- use syntax:: ast;
23
22
use syntax:: attr:: { self , UnwindAttr } ;
24
23
use syntax:: symbol:: keywords;
25
24
use syntax_pos:: Span ;
@@ -376,7 +375,7 @@ struct Builder<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
376
375
377
376
/// Maps `NodeId`s of variable bindings to the `Local`s created for them.
378
377
/// (A match binding can have two locals; the 2nd is for the arm's guard.)
379
- var_indices : NodeMap < LocalsForNode > ,
378
+ var_indices : HirIdMap < LocalsForNode > ,
380
379
local_decls : IndexVec < Local , LocalDecl < ' tcx > > ,
381
380
canonical_user_type_annotations : ty:: CanonicalUserTypeAnnotations < ' tcx > ,
382
381
upvar_decls : Vec < UpvarDecl > ,
@@ -392,11 +391,11 @@ struct Builder<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
392
391
}
393
392
394
393
impl < ' a , ' gcx , ' tcx > Builder < ' a , ' gcx , ' tcx > {
395
- fn is_bound_var_in_guard ( & self , id : ast :: NodeId ) -> bool {
394
+ fn is_bound_var_in_guard ( & self , id : hir :: HirId ) -> bool {
396
395
self . guard_context . iter ( ) . any ( |frame| frame. locals . iter ( ) . any ( |local| local. id == id) )
397
396
}
398
397
399
- fn var_local_id ( & self , id : ast :: NodeId , for_guard : ForGuard ) -> Local {
398
+ fn var_local_id ( & self , id : hir :: HirId , for_guard : ForGuard ) -> Local {
400
399
self . var_indices [ & id] . local_id ( for_guard)
401
400
}
402
401
}
@@ -471,11 +470,11 @@ enum LocalsForNode {
471
470
472
471
#[ derive( Debug ) ]
473
472
struct GuardFrameLocal {
474
- id : ast :: NodeId ,
473
+ id : hir :: HirId ,
475
474
}
476
475
477
476
impl GuardFrameLocal {
478
- fn new ( id : ast :: NodeId , _binding_mode : BindingMode ) -> Self {
477
+ fn new ( id : hir :: HirId , _binding_mode : BindingMode ) -> Self {
479
478
GuardFrameLocal {
480
479
id : id,
481
480
}
@@ -650,7 +649,7 @@ fn construct_fn<'a, 'gcx, 'tcx, A>(hir: Cx<'a, 'gcx, 'tcx>,
650
649
mutability : Mutability :: Not ,
651
650
} ;
652
651
if let Some ( Node :: Binding ( pat) ) = tcx_hir. find ( var_node_id) {
653
- if let hir:: PatKind :: Binding ( _, _, _ , ident, _) = pat. node {
652
+ if let hir:: PatKind :: Binding ( _, _, ident, _) = pat. node {
654
653
decl. debug_name = ident. name ;
655
654
if let Some ( & bm) = hir. tables . pat_binding_modes ( ) . get ( pat. hir_id ) {
656
655
if bm == ty:: BindByValue ( hir:: MutMutable ) {
@@ -855,8 +854,8 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
855
854
let mut name = None ;
856
855
if let Some ( pat) = pattern {
857
856
match pat. node {
858
- hir:: PatKind :: Binding ( hir:: BindingAnnotation :: Unannotated , _, _ , ident, _)
859
- | hir:: PatKind :: Binding ( hir:: BindingAnnotation :: Mutable , _, _ , ident, _) => {
857
+ hir:: PatKind :: Binding ( hir:: BindingAnnotation :: Unannotated , _, ident, _)
858
+ | hir:: PatKind :: Binding ( hir:: BindingAnnotation :: Mutable , _, ident, _) => {
860
859
name = Some ( ident. name ) ;
861
860
}
862
861
_ => ( ) ,
0 commit comments