debug!("add_moved_or_invoked_closure_note: closure={:?}", closure);
if let ty::Closure(did, _) = self.body.local_decls[closure].ty.kind {
let did = did.expect_local();
- let hir_id = self.infcx.tcx.hir().as_local_hir_id(did);
+ let hir_id = self.infcx.tcx.hir().local_def_id_to_hir_id(did);
if let Some((span, name)) =
self.infcx.tcx.typeck(did).closure_kind_origins().get(hir_id)
if let Some(target) = target {
if let ty::Closure(did, _) = self.body.local_decls[target].ty.kind {
let did = did.expect_local();
- let hir_id = self.infcx.tcx.hir().as_local_hir_id(did);
+ let hir_id = self.infcx.tcx.hir().local_def_id_to_hir_id(did);
if let Some((span, name)) =
self.infcx.tcx.typeck(did).closure_kind_origins().get(hir_id)
"closure_span: def_id={:?} target_place={:?} places={:?}",
def_id, target_place, places
);
- let hir_id = self.infcx.tcx.hir().as_local_hir_id(def_id.as_local()?);
+ let hir_id = self.infcx.tcx.hir().local_def_id_to_hir_id(def_id.as_local()?);
let expr = &self.infcx.tcx.hir().expect_expr(hir_id).kind;
debug!("closure_span: hir_id={:?} expr={:?}", hir_id, expr);
if let hir::ExprKind::Closure(.., body_id, args_span, _) = expr {