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