We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2341f21 commit 9d6214fCopy full SHA for 9d6214f
compiler/rustc_ast_lowering/src/lib.rs
@@ -646,9 +646,13 @@ impl<'hir> LoweringContext<'hir> {
646
}
647
648
649
+ /// Generate a new `HirId` without a backing `NodeId`.
650
fn next_id(&mut self) -> hir::HirId {
- let node_id = self.next_node_id();
651
- self.lower_node_id(node_id)
+ let owner = self.current_hir_id_owner;
652
+ let local_id = self.item_local_id_counter;
653
+ assert_ne!(local_id, hir::ItemLocalId::new(0));
654
+ self.item_local_id_counter.increment_by(1);
655
+ hir::HirId { owner, local_id }
656
657
658
fn lower_res(&mut self, res: Res<NodeId>) -> Res {
0 commit comments