@@ -228,6 +228,7 @@ use std::fmt;
228228use std:: rc:: Rc ;
229229use rustc_front:: hir;
230230use syntax:: ast:: { self , DUMMY_NODE_ID , NodeId } ;
231+ use syntax:: ext:: mtwt;
231232use syntax:: codemap:: Span ;
232233use rustc_front:: fold:: Folder ;
233234use syntax:: ptr:: P ;
@@ -477,7 +478,7 @@ fn expand_nested_bindings<'a, 'p, 'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
477478 loop {
478479 pat = match pat. node {
479480 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 ) ) ;
481482 & * * inner
482483 } ,
483484 _ => break
@@ -518,15 +519,15 @@ fn enter_match<'a, 'b, 'p, 'blk, 'tcx, F>(bcx: Block<'blk, 'tcx>,
518519 match this. node {
519520 hir:: PatIdent ( _, ref path, None ) => {
520521 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 ) ) ;
522523 }
523524 }
524525 hir:: PatVec ( ref before, Some ( ref slice) , ref after) => {
525526 if let hir:: PatIdent ( _, ref path, None ) = slice. node {
526527 let subslice_val = bind_subslice_pat (
527528 bcx, this. id , val,
528529 before. len ( ) , after. len ( ) ) ;
529- bound_ptrs. push ( ( path. node . name , subslice_val) ) ;
530+ bound_ptrs. push ( ( mtwt :: resolve ( path. node ) , subslice_val) ) ;
530531 }
531532 }
532533 _ => { }
@@ -1127,8 +1128,8 @@ fn compile_submatch<'a, 'p, 'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
11271128 }
11281129 None => {
11291130 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 ( ) ;
11321133 call_lifetime_start ( bcx, binfo. llmatch ) ;
11331134 if binfo. trmode == TrByRef && type_is_fat_ptr ( bcx. tcx ( ) , binfo. ty ) {
11341135 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,
15261527 let tcx = bcx. tcx ( ) ;
15271528 let reassigned = is_discr_reassigned ( bcx, discr, body) ;
15281529 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 ) ;
15311532 let variable_ty = node_id_type ( bcx, p_id) ;
15321533 let llvariable_ty = type_of:: type_of ( ccx, variable_ty) ;
15331534 let tcx = bcx. tcx ( ) ;
0 commit comments