File tree 2 files changed +7
-1
lines changed
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -869,6 +869,10 @@ fn for_each_late_bound_region_in_item<'tcx>(
869
869
mir_def_id : LocalDefId ,
870
870
mut f : impl FnMut ( ty:: Region < ' tcx > ) ,
871
871
) {
872
+ if !tcx. def_kind ( mir_def_id) . is_fn_like ( ) {
873
+ return ;
874
+ }
875
+
872
876
for bound_var in tcx. late_bound_vars ( tcx. hir ( ) . local_def_id_to_hir_id ( mir_def_id) ) {
873
877
let ty:: BoundVariableKind :: Region ( bound_region) = bound_var else { continue ; } ;
874
878
let liberated_region = tcx
Original file line number Diff line number Diff line change @@ -2895,7 +2895,9 @@ impl<'tcx> TyCtxt<'tcx> {
2895
2895
self . mk_bound_variable_kinds (
2896
2896
self . late_bound_vars_map ( id. owner )
2897
2897
. 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
+ } )
2899
2901
. iter ( ) ,
2900
2902
)
2901
2903
}
You can’t perform that action at this time.
0 commit comments