@@ -10,7 +10,6 @@ use rustc::ty::subst::{InternalSubsts, SubstsRef};
10
10
use rustc:: ty:: { self , AdtKind , Ty } ;
11
11
use rustc_hir as hir;
12
12
use rustc_hir:: def:: { CtorKind , CtorOf , DefKind , Res } ;
13
- use rustc_hir:: def_id:: LocalDefId ;
14
13
use rustc_index:: vec:: Idx ;
15
14
use rustc_span:: Span ;
16
15
@@ -812,7 +811,7 @@ fn convert_var<'tcx>(
812
811
let closure_def_id = cx. body_owner ;
813
812
let upvar_id = ty:: UpvarId {
814
813
var_path : ty:: UpvarPath { hir_id : var_hir_id } ,
815
- closure_expr_id : LocalDefId :: from_def_id ( closure_def_id) ,
814
+ closure_expr_id : closure_def_id. expect_local ( ) ,
816
815
} ;
817
816
let var_ty = cx. tables ( ) . node_type ( var_hir_id) ;
818
817
@@ -987,7 +986,7 @@ fn capture_upvar<'tcx>(
987
986
) -> ExprRef < ' tcx > {
988
987
let upvar_id = ty:: UpvarId {
989
988
var_path : ty:: UpvarPath { hir_id : var_hir_id } ,
990
- closure_expr_id : cx. tcx . hir ( ) . local_def_id ( closure_expr. hir_id ) . to_local ( ) ,
989
+ closure_expr_id : cx. tcx . hir ( ) . local_def_id ( closure_expr. hir_id ) . expect_local ( ) ,
991
990
} ;
992
991
let upvar_capture = cx. tables ( ) . upvar_capture ( upvar_id) ;
993
992
let temp_lifetime = cx. region_scope_tree . temporary_scope ( closure_expr. hir_id . local_id ) ;
0 commit comments