Skip to content

Commit 384189c

Browse files
committedJan 26, 2022
Filter out local_id == 0, those are already considered on the call site
1 parent 14a64e0 commit 384189c

File tree

1 file changed

+6
-2
lines changed
  • compiler/rustc_ast_lowering/src

1 file changed

+6
-2
lines changed
 

‎compiler/rustc_ast_lowering/src/lib.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -483,9 +483,13 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
483483
let local_id_to_def_id = local_node_ids
484484
.iter()
485485
.filter_map(|&node_id| {
486-
let def_id = self.resolver.opt_local_def_id(node_id)?;
487486
let hir_id = self.node_id_to_hir_id[node_id]?;
488-
Some((hir_id.local_id, def_id))
487+
if hir_id.local_id == hir::ItemLocalId::new(0) {
488+
None
489+
} else {
490+
let def_id = self.resolver.opt_local_def_id(node_id)?;
491+
Some((hir_id.local_id, def_id))
492+
}
489493
})
490494
.collect();
491495

0 commit comments

Comments
 (0)
Please sign in to comment.