@@ -226,6 +226,7 @@ use std::fmt;
226226use std:: rc:: Rc ;
227227use rustc_front:: hir;
228228use syntax:: ast:: { self , DUMMY_NODE_ID , NodeId } ;
229+ use syntax:: ext:: mtwt;
229230use syntax:: codemap:: Span ;
230231use rustc_front:: fold:: Folder ;
231232use syntax:: ptr:: P ;
@@ -475,7 +476,7 @@ fn expand_nested_bindings<'a, 'p, 'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
475476 loop {
476477 pat = match pat. node {
477478 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 ) ) ;
479480 & * * inner
480481 } ,
481482 _ => break
@@ -516,15 +517,15 @@ fn enter_match<'a, 'b, 'p, 'blk, 'tcx, F>(bcx: Block<'blk, 'tcx>,
516517 match this. node {
517518 hir:: PatIdent ( _, ref path, None ) => {
518519 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 ) ) ;
520521 }
521522 }
522523 hir:: PatVec ( ref before, Some ( ref slice) , ref after) => {
523524 if let hir:: PatIdent ( _, ref path, None ) = slice. node {
524525 let subslice_val = bind_subslice_pat (
525526 bcx, this. id , val,
526527 before. len ( ) , after. len ( ) ) ;
527- bound_ptrs. push ( ( path. node . name , subslice_val) ) ;
528+ bound_ptrs. push ( ( mtwt :: resolve ( path. node ) , subslice_val) ) ;
528529 }
529530 }
530531 _ => { }
@@ -1125,8 +1126,8 @@ fn compile_submatch<'a, 'p, 'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
11251126 }
11261127 None => {
11271128 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 ( ) ;
11301131 call_lifetime_start ( bcx, binfo. llmatch ) ;
11311132 if binfo. trmode == TrByRef && type_is_fat_ptr ( bcx. tcx ( ) , binfo. ty ) {
11321133 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,
15241525 let tcx = bcx. tcx ( ) ;
15251526 let reassigned = is_discr_reassigned ( bcx, discr, body) ;
15261527 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 ) ;
15291530 let variable_ty = node_id_type ( bcx, p_id) ;
15301531 let llvariable_ty = type_of:: type_of ( ccx, variable_ty) ;
15311532 let tcx = bcx. tcx ( ) ;
0 commit comments