/// Construct the MIR for a given `DefId`.
fn mir_build(tcx: TyCtxt<'_>, def: ty::WithOptConstParam<LocalDefId>) -> Body<'_> {
- let id = tcx.hir().as_local_hir_id(def.did);
+ let id = tcx.hir().local_def_id_to_hir_id(def.did);
// Figure out what primary body this item has.
let (body_id, return_ty_span) = match tcx.hir().get(id) {