hir: Make sure all HirIds have corresponding HIR Nodes

This commit is contained in:
Vadim Petrochenkov 2024-01-20 15:21:27 +03:00
parent d4f6f9ee6a
commit 363b098245
10 changed files with 79 additions and 37 deletions

View file

@ -216,7 +216,8 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
if let Some(id) = placeholder.bound.kind.get_id()
&& let Some(placeholder_id) = id.as_local()
&& let gat_hir_id = self.infcx.tcx.local_def_id_to_hir_id(placeholder_id)
&& let Some(generics_impl) = hir.get_parent(gat_hir_id).generics()
&& let Some(generics_impl) =
hir.get_parent(hir.parent_id(gat_hir_id)).generics()
{
Some((gat_hir_id, generics_impl))
} else {