@@ -134,7 +134,9 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
134
134
self . tcx . with_freevars ( closure_node_id, |freevars| {
135
135
for freevar in freevars {
136
136
let upvar_id = ty:: UpvarId {
137
- var_id : self . tcx . hir . node_to_hir_id ( freevar. var_id ( ) ) ,
137
+ var_path : ty:: UpvarPath {
138
+ hir_id : self . tcx . hir . node_to_hir_id ( freevar. var_id ( ) ) ,
139
+ } ,
138
140
closure_expr_id : LocalDefId :: from_def_id ( closure_def_id) ,
139
141
} ;
140
142
debug ! ( "seed upvar_id {:?}" , upvar_id) ;
@@ -248,7 +250,9 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
248
250
let var_hir_id = tcx. hir . node_to_hir_id ( var_node_id) ;
249
251
let freevar_ty = self . node_ty ( var_hir_id) ;
250
252
let upvar_id = ty:: UpvarId {
251
- var_id : var_hir_id,
253
+ var_path : ty:: UpvarPath {
254
+ hir_id : var_hir_id,
255
+ } ,
252
256
closure_expr_id : LocalDefId :: from_def_id ( closure_def_index) ,
253
257
} ;
254
258
let capture = self . tables . borrow ( ) . upvar_capture ( upvar_id) ;
@@ -347,7 +351,7 @@ impl<'a, 'gcx, 'tcx> InferBorrowKind<'a, 'gcx, 'tcx> {
347
351
upvar_id. closure_expr_id ,
348
352
ty:: ClosureKind :: FnOnce ,
349
353
guarantor. span ,
350
- var_name ( tcx, upvar_id. var_id ) ,
354
+ var_name ( tcx, upvar_id. var_path . hir_id ) ,
351
355
) ;
352
356
353
357
self . adjust_upvar_captures
@@ -364,7 +368,7 @@ impl<'a, 'gcx, 'tcx> InferBorrowKind<'a, 'gcx, 'tcx> {
364
368
upvar_id. closure_expr_id ,
365
369
ty:: ClosureKind :: FnOnce ,
366
370
guarantor. span ,
367
- var_name ( tcx, upvar_id. var_id ) ,
371
+ var_name ( tcx, upvar_id. var_path . hir_id ) ,
368
372
) ;
369
373
}
370
374
mc:: NoteIndex | mc:: NoteNone => { }
@@ -465,7 +469,7 @@ impl<'a, 'gcx, 'tcx> InferBorrowKind<'a, 'gcx, 'tcx> {
465
469
upvar_id. closure_expr_id ,
466
470
ty:: ClosureKind :: FnMut ,
467
471
cmt. span ,
468
- var_name ( tcx, upvar_id. var_id ) ,
472
+ var_name ( tcx, upvar_id. var_path . hir_id ) ,
469
473
) ;
470
474
471
475
true
@@ -478,7 +482,7 @@ impl<'a, 'gcx, 'tcx> InferBorrowKind<'a, 'gcx, 'tcx> {
478
482
upvar_id. closure_expr_id ,
479
483
ty:: ClosureKind :: FnMut ,
480
484
cmt. span ,
481
- var_name ( tcx, upvar_id. var_id ) ,
485
+ var_name ( tcx, upvar_id. var_path . hir_id ) ,
482
486
) ;
483
487
484
488
true
0 commit comments