Skip to content

Commit

Permalink
Filter out local_id == 0, those are already considered on the call site
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Jan 26, 2022
1 parent 14a64e0 commit 384189c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions compiler/rustc_ast_lowering/src/lib.rs
Expand Up @@ -483,9 +483,13 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
let local_id_to_def_id = local_node_ids
.iter()
.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]?;
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();

Expand Down

0 comments on commit 384189c

Please sign in to comment.