self.tcx.sess.source_map().guess_head_span(
self.tcx.hir().span_if_local(closure_def_id).unwrap(),
);
- let hir_id = self.tcx.hir().as_local_hir_id(closure_def_id.expect_local());
+ let hir_id =
+ self.tcx.hir().local_def_id_to_hir_id(closure_def_id.expect_local());
let mut err = struct_span_err!(
self.tcx.sess,
closure_span,