Add bug! back to late_bound_vars query

This commit is contained in:
Michael Goulet 2022-10-31 21:24:39 +00:00
parent 4427af0827
commit 2768c2fb25
2 changed files with 7 additions and 1 deletions

View File

@ -869,6 +869,10 @@ fn for_each_late_bound_region_in_item<'tcx>(
mir_def_id: LocalDefId,
mut f: impl FnMut(ty::Region<'tcx>),
) {
if !tcx.def_kind(mir_def_id).is_fn_like() {
return;
}
for bound_var in tcx.late_bound_vars(tcx.hir().local_def_id_to_hir_id(mir_def_id)) {
let ty::BoundVariableKind::Region(bound_region) = bound_var else { continue; };
let liberated_region = tcx

View File

@ -2895,7 +2895,9 @@ impl<'tcx> TyCtxt<'tcx> {
self.mk_bound_variable_kinds(
self.late_bound_vars_map(id.owner)
.and_then(|map| map.get(&id.local_id).cloned())
.unwrap_or_default()
.unwrap_or_else(|| {
bug!("No bound vars found for {:?} ({:?})", self.hir().node_to_string(id), id)
})
.iter(),
)
}