@@ -418,7 +418,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
418
418
let opaque_type = tcx. mk_opaque ( def_id, opaque_defn. substs ) ;
419
419
420
420
let required_region_bounds =
421
- required_region_bounds ( tcx, opaque_type, bounds. predicates ) ;
421
+ required_region_bounds ( tcx, opaque_type, bounds. predicates . into_iter ( ) ) ;
422
422
debug_assert ! ( !required_region_bounds. is_empty( ) ) ;
423
423
424
424
for required_region in required_region_bounds {
@@ -1127,7 +1127,8 @@ impl<'a, 'tcx> Instantiator<'a, 'tcx> {
1127
1127
1128
1128
debug ! ( "instantiate_opaque_types: bounds={:?}" , bounds) ;
1129
1129
1130
- let required_region_bounds = required_region_bounds ( tcx, ty, bounds. predicates . clone ( ) ) ;
1130
+ let required_region_bounds =
1131
+ required_region_bounds ( tcx, ty, bounds. predicates . iter ( ) . cloned ( ) ) ;
1131
1132
debug ! ( "instantiate_opaque_types: required_region_bounds={:?}" , required_region_bounds) ;
1132
1133
1133
1134
// Make sure that we are in fact defining the *entire* type
@@ -1245,17 +1246,15 @@ pub fn may_define_opaque_type(tcx: TyCtxt<'_>, def_id: DefId, opaque_hir_id: hir
1245
1246
crate fn required_region_bounds (
1246
1247
tcx : TyCtxt < ' tcx > ,
1247
1248
erased_self_ty : Ty < ' tcx > ,
1248
- predicates : Vec < ty:: Predicate < ' tcx > > ,
1249
+ predicates : impl Iterator < Item = ty:: Predicate < ' tcx > > ,
1249
1250
) -> Vec < ty:: Region < ' tcx > > {
1250
- debug ! (
1251
- "required_region_bounds(erased_self_ty={:?}, predicates={:?})" ,
1252
- erased_self_ty, predicates
1253
- ) ;
1251
+ debug ! ( "required_region_bounds(erased_self_ty={:?})" , erased_self_ty) ;
1254
1252
1255
1253
assert ! ( !erased_self_ty. has_escaping_bound_vars( ) ) ;
1256
1254
1257
1255
traits:: elaborate_predicates ( tcx, predicates)
1258
1256
. filter_map ( |obligation| {
1257
+ debug ! ( "required_region_bounds(obligation={:?})" , obligation) ;
1259
1258
match obligation. predicate {
1260
1259
ty:: Predicate :: Projection ( ..)
1261
1260
| ty:: Predicate :: Trait ( ..)
0 commit comments