@@ -226,6 +226,7 @@ use std::fmt;
226
226
use std:: rc:: Rc ;
227
227
use rustc_front:: hir;
228
228
use syntax:: ast:: { self , DUMMY_NODE_ID , NodeId } ;
229
+ use syntax:: ext:: mtwt;
229
230
use syntax:: codemap:: Span ;
230
231
use rustc_front:: fold:: Folder ;
231
232
use syntax:: ptr:: P ;
@@ -475,7 +476,7 @@ fn expand_nested_bindings<'a, 'p, 'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
475
476
loop {
476
477
pat = match pat. node {
477
478
hir:: PatIdent ( _, ref path, Some ( ref inner) ) => {
478
- bound_ptrs. push ( ( path. node . name , val. val ) ) ;
479
+ bound_ptrs. push ( ( mtwt :: resolve ( path. node ) , val. val ) ) ;
479
480
& * * inner
480
481
} ,
481
482
_ => break
@@ -516,15 +517,15 @@ fn enter_match<'a, 'b, 'p, 'blk, 'tcx, F>(bcx: Block<'blk, 'tcx>,
516
517
match this. node {
517
518
hir:: PatIdent ( _, ref path, None ) => {
518
519
if pat_is_binding ( dm, & * this) {
519
- bound_ptrs. push ( ( path. node . name , val. val ) ) ;
520
+ bound_ptrs. push ( ( mtwt :: resolve ( path. node ) , val. val ) ) ;
520
521
}
521
522
}
522
523
hir:: PatVec ( ref before, Some ( ref slice) , ref after) => {
523
524
if let hir:: PatIdent ( _, ref path, None ) = slice. node {
524
525
let subslice_val = bind_subslice_pat (
525
526
bcx, this. id , val,
526
527
before. len ( ) , after. len ( ) ) ;
527
- bound_ptrs. push ( ( path. node . name , subslice_val) ) ;
528
+ bound_ptrs. push ( ( mtwt :: resolve ( path. node ) , subslice_val) ) ;
528
529
}
529
530
}
530
531
_ => { }
@@ -1125,8 +1126,8 @@ fn compile_submatch<'a, 'p, 'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
1125
1126
}
1126
1127
None => {
1127
1128
let data = & m[ 0 ] . data ;
1128
- for & ( ref ident , ref value_ptr) in & m[ 0 ] . bound_ptrs {
1129
- let binfo = * data. bindings_map . get ( ident ) . unwrap ( ) ;
1129
+ for & ( ref name , ref value_ptr) in & m[ 0 ] . bound_ptrs {
1130
+ let binfo = * data. bindings_map . get ( name ) . unwrap ( ) ;
1130
1131
call_lifetime_start ( bcx, binfo. llmatch ) ;
1131
1132
if binfo. trmode == TrByRef && type_is_fat_ptr ( bcx. tcx ( ) , binfo. ty ) {
1132
1133
expr:: copy_fat_ptr ( bcx, * value_ptr, binfo. llmatch ) ;
@@ -1524,8 +1525,8 @@ fn create_bindings_map<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, pat: &hir::Pat,
1524
1525
let tcx = bcx. tcx ( ) ;
1525
1526
let reassigned = is_discr_reassigned ( bcx, discr, body) ;
1526
1527
let mut bindings_map = FnvHashMap ( ) ;
1527
- pat_bindings ( & tcx. def_map , & * pat, |bm, p_id, span, path1| {
1528
- let name = path1. node ;
1528
+ pat_bindings_hygienic ( & tcx. def_map , & * pat, |bm, p_id, span, path1| {
1529
+ let name = mtwt :: resolve ( path1. node ) ;
1529
1530
let variable_ty = node_id_type ( bcx, p_id) ;
1530
1531
let llvariable_ty = type_of:: type_of ( ccx, variable_ty) ;
1531
1532
let tcx = bcx. tcx ( ) ;
0 commit comments