Remove HirId -> LocalDefId map from HIR.

This commit is contained in:
Camille GILLOT 2022-11-05 15:33:58 +00:00
parent 3175d03d3b
commit 15d6325747
46 changed files with 321 additions and 382 deletions

View file

@ -540,7 +540,8 @@ fn fn_sig_and_body(
// FIXME(#79625): Consider improving MIR to provide the information needed, to avoid going back
// to HIR for it.
let hir_node = tcx.hir().get_if_local(def_id).expect("expected DefId is local");
let fn_body_id = hir::map::associated_body(hir_node).expect("HIR node is a function with body");
let (_, fn_body_id) =
hir::map::associated_body(hir_node).expect("HIR node is a function with body");
(hir_node.fn_sig(), tcx.hir().body(fn_body_id))
}