Filter out local_id == 0, those are already considered on the call site

This commit is contained in:
Santiago Pastorino 2022-01-26 09:53:17 -03:00
parent 14a64e0a55
commit 384189c3d9
No known key found for this signature in database
GPG Key ID: 8131A24E0C79EFAF

View File

@ -483,9 +483,13 @@ fn make_owner_info(&mut self, node: hir::OwnerNode<'hir>) -> hir::OwnerInfo<'hir
let local_id_to_def_id = local_node_ids let local_id_to_def_id = local_node_ids
.iter() .iter()
.filter_map(|&node_id| { .filter_map(|&node_id| {
let def_id = self.resolver.opt_local_def_id(node_id)?;
let hir_id = self.node_id_to_hir_id[node_id]?; let hir_id = self.node_id_to_hir_id[node_id]?;
Some((hir_id.local_id, def_id)) if hir_id.local_id == hir::ItemLocalId::new(0) {
None
} else {
let def_id = self.resolver.opt_local_def_id(node_id)?;
Some((hir_id.local_id, def_id))
}
}) })
.collect(); .collect();