Only allow feeding a value to newly created definitions.

This commit is contained in:
Camille GILLOT
2022-11-26 13:54:45 +00:00
parent 9f2c6b0b09
commit 731c002b27
6 changed files with 47 additions and 33 deletions

View File

@@ -497,7 +497,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
self.tcx.hir().def_key(self.local_def_id(node_id)),
);
let def_id = self.tcx.create_def(parent, data);
let def_id = self.tcx.create_def(parent, data).def_id;
debug!("create_def: def_id_to_node_id[{:?}] <-> {:?}", def_id, node_id);
self.resolver.node_id_to_def_id.insert(node_id, def_id);