@@ -10,7 +10,6 @@ use rustc::ty::subst::{InternalSubsts, SubstsRef};
1010use rustc:: ty:: { self , AdtKind , Ty } ;
1111use rustc_hir as hir;
1212use rustc_hir:: def:: { CtorKind , CtorOf , DefKind , Res } ;
13- use rustc_hir:: def_id:: LocalDefId ;
1413use rustc_index:: vec:: Idx ;
1514use rustc_span:: Span ;
1615
@@ -812,7 +811,7 @@ fn convert_var<'tcx>(
812811 let closure_def_id = cx. body_owner ;
813812 let upvar_id = ty:: UpvarId {
814813 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 ( ) ,
816815 } ;
817816 let var_ty = cx. tables ( ) . node_type ( var_hir_id) ;
818817
@@ -987,7 +986,7 @@ fn capture_upvar<'tcx>(
987986) -> ExprRef < ' tcx > {
988987 let upvar_id = ty:: UpvarId {
989988 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 ( ) ,
991990 } ;
992991 let upvar_capture = cx. tables ( ) . upvar_capture ( upvar_id) ;
993992 let temp_lifetime = cx. region_scope_tree . temporary_scope ( closure_expr. hir_id . local_id ) ;
0 commit comments