1
Fork 0

Store hir_id_to_def_id in OwnerInfo.

This commit is contained in:
Camille GILLOT 2021-11-21 19:04:47 +01:00 committed by Santiago Pastorino
parent 17dfae79bb
commit 80132c3ce4
No known key found for this signature in database
GPG key ID: 8131A24E0C79EFAF
5 changed files with 31 additions and 19 deletions

View file

@ -204,8 +204,11 @@ impl<'hir> Map<'hir> {
if hir_id.local_id == ItemLocalId::new(0) {
Some(hir_id.owner)
} else {
// FIXME(#85914) is this access safe for incr. comp.?
self.tcx.untracked_resolutions.definitions.opt_hir_id_to_local_def_id(hir_id)
self.tcx
.hir_owner_nodes(hir_id.owner)?
.local_id_to_def_id
.get(&hir_id.local_id)
.copied()
}
}