Store def_id_to_hir_id as variant in hir_owner.

If hir_owner is Owner(_), the LocalDefId is pointing to an owner, so the ItemLocalId is 0.
If the HIR node does not exist, we store Phantom.
Otherwise, we store the HirId associated to the LocalDefId.
This commit is contained in:
Camille GILLOT 2021-09-22 19:28:20 +02:00 committed by Santiago Pastorino
parent 009c1d0248
commit a0bcce4884
No known key found for this signature in database
GPG key ID: 8131A24E0C79EFAF
11 changed files with 123 additions and 112 deletions

View file

@ -579,7 +579,7 @@ fn hash_mir_source<'tcx>(tcx: TyCtxt<'tcx>, hir_body: &'tcx rustc_hir::Body<'tcx
let mut hcx = tcx.create_no_span_stable_hashing_context();
let mut stable_hasher = StableHasher::new();
let owner = hir_body.id().hir_id.owner;
let bodies = &tcx.hir_owner_nodes(owner).as_ref().unwrap().bodies;
let bodies = &tcx.hir_owner_nodes(owner).unwrap().bodies;
hcx.with_hir_bodies(false, owner, bodies, |hcx| {
hir_body.value.hash_stable(hcx, &mut stable_hasher)
});