Add bug! back to late_bound_vars query
This commit is contained in:
parent
4427af0827
commit
2768c2fb25
@ -869,6 +869,10 @@ fn for_each_late_bound_region_in_item<'tcx>(
|
|||||||
mir_def_id: LocalDefId,
|
mir_def_id: LocalDefId,
|
||||||
mut f: impl FnMut(ty::Region<'tcx>),
|
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)) {
|
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 ty::BoundVariableKind::Region(bound_region) = bound_var else { continue; };
|
||||||
let liberated_region = tcx
|
let liberated_region = tcx
|
||||||
|
@ -2895,7 +2895,9 @@ impl<'tcx> TyCtxt<'tcx> {
|
|||||||
self.mk_bound_variable_kinds(
|
self.mk_bound_variable_kinds(
|
||||||
self.late_bound_vars_map(id.owner)
|
self.late_bound_vars_map(id.owner)
|
||||||
.and_then(|map| map.get(&id.local_id).cloned())
|
.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(),
|
.iter(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user