Do not ICE when accesing large LocalDefId.

This commit is contained in:
Camille GILLOT 2021-10-22 16:43:43 +02:00
parent 67727aa7c3
commit d9c6e70c57

View File

@ -64,7 +64,7 @@ pub fn provide(providers: &mut Providers) {
providers.crate_hash = map::crate_hash;
providers.hir_module_items = map::hir_module_items;
providers.hir_owner = |tcx, id| {
let owner = tcx.hir_crate(()).owners[id].as_ref()?;
let owner = tcx.hir_crate(()).owners.get(id)?.as_ref()?;
let node = owner.node();
Some(Owner { node, hash_without_bodies: owner.nodes.hash_without_bodies })
};