Skip to content

Commit 2768c2f

Browse files
Add bug! back to late_bound_vars query
1 parent 4427af0 commit 2768c2f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

compiler/rustc_borrowck/src/universal_regions.rs

+4
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,10 @@ fn for_each_late_bound_region_in_item<'tcx>(
869869
mir_def_id: LocalDefId,
870870
mut f: impl FnMut(ty::Region<'tcx>),
871871
) {
872+
if !tcx.def_kind(mir_def_id).is_fn_like() {
873+
return;
874+
}
875+
872876
for bound_var in tcx.late_bound_vars(tcx.hir().local_def_id_to_hir_id(mir_def_id)) {
873877
let ty::BoundVariableKind::Region(bound_region) = bound_var else { continue; };
874878
let liberated_region = tcx

compiler/rustc_middle/src/ty/context.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -2895,7 +2895,9 @@ impl<'tcx> TyCtxt<'tcx> {
28952895
self.mk_bound_variable_kinds(
28962896
self.late_bound_vars_map(id.owner)
28972897
.and_then(|map| map.get(&id.local_id).cloned())
2898-
.unwrap_or_default()
2898+
.unwrap_or_else(|| {
2899+
bug!("No bound vars found for {:?} ({:?})", self.hir().node_to_string(id), id)
2900+
})
28992901
.iter(),
29002902
)
29012903
}

0 commit comments

Comments
 (0)