use rustc::ty::{self, AdtKind, Ty};
use rustc_hir as hir;
use rustc_hir::def::{CtorKind, CtorOf, DefKind, Res};
-use rustc_hir::def_id::LocalDefId;
use rustc_index::vec::Idx;
use rustc_span::Span;
let closure_def_id = cx.body_owner;
let upvar_id = ty::UpvarId {
var_path: ty::UpvarPath { hir_id: var_hir_id },
- closure_expr_id: LocalDefId::from_def_id(closure_def_id),
+ closure_expr_id: closure_def_id.expect_local(),
};
let var_ty = cx.tables().node_type(var_hir_id);
) -> ExprRef<'tcx> {
let upvar_id = ty::UpvarId {
var_path: ty::UpvarPath { hir_id: var_hir_id },
- closure_expr_id: cx.tcx.hir().local_def_id(closure_expr.hir_id).to_local(),
+ closure_expr_id: cx.tcx.hir().local_def_id(closure_expr.hir_id).expect_local(),
};
let upvar_capture = cx.tables().upvar_capture(upvar_id);
let temp_lifetime = cx.region_scope_tree.temporary_scope(closure_expr.hir_id.local_id);