1
Fork 0

Assert that HIR nodes are not their own parent.

This commit is contained in:
Camille GILLOT 2022-09-11 15:11:58 +02:00
parent ccb5595df2
commit 51f486931f
4 changed files with 13 additions and 1 deletions

View file

@ -69,6 +69,7 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
fn insert(&mut self, span: Span, hir_id: HirId, node: Node<'hir>) {
debug_assert_eq!(self.owner, hir_id.owner);
debug_assert_ne!(hir_id.local_id.as_u32(), 0);
debug_assert_ne!(hir_id.local_id, self.parent_node);
// Make sure that the DepNode of some node coincides with the HirId
// owner of that node.