]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_borrowck/src/universal_regions.rs
Auto merge of #102935 - ajtribick:display-float-0.5-fixed-0, r=scottmcm
[rust.git] / compiler / rustc_borrowck / src / universal_regions.rs
index 482e10d520b76c8b36a323f9f3caa4c219042651..618da9e3253252886807c2413eb32a57a5d55af4 100644 (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