@@ -418,7 +418,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
418418 let opaque_type = tcx. mk_opaque ( def_id, opaque_defn. substs ) ;
419419
420420 let required_region_bounds =
421- required_region_bounds ( tcx, opaque_type, bounds. predicates ) ;
421+ required_region_bounds ( tcx, opaque_type, bounds. predicates . into_iter ( ) ) ;
422422 debug_assert ! ( !required_region_bounds. is_empty( ) ) ;
423423
424424 for required_region in required_region_bounds {
@@ -1137,7 +1137,8 @@ impl<'a, 'tcx> Instantiator<'a, 'tcx> {
11371137
11381138 debug ! ( "instantiate_opaque_types: bounds={:?}" , bounds) ;
11391139
1140- let required_region_bounds = required_region_bounds ( tcx, ty, bounds. predicates . clone ( ) ) ;
1140+ let required_region_bounds =
1141+ required_region_bounds ( tcx, ty, bounds. predicates . iter ( ) . cloned ( ) ) ;
11411142 debug ! ( "instantiate_opaque_types: required_region_bounds={:?}" , required_region_bounds) ;
11421143
11431144 // Make sure that we are in fact defining the *entire* type
@@ -1259,17 +1260,15 @@ pub fn may_define_opaque_type(
12591260crate fn required_region_bounds (
12601261 tcx : TyCtxt < ' tcx > ,
12611262 erased_self_ty : Ty < ' tcx > ,
1262- predicates : Vec < ty:: Predicate < ' tcx > > ,
1263+ predicates : impl Iterator < Item = ty:: Predicate < ' tcx > > ,
12631264) -> Vec < ty:: Region < ' tcx > > {
1264- debug ! (
1265- "required_region_bounds(erased_self_ty={:?}, predicates={:?})" ,
1266- erased_self_ty, predicates
1267- ) ;
1265+ debug ! ( "required_region_bounds(erased_self_ty={:?})" , erased_self_ty) ;
12681266
12691267 assert ! ( !erased_self_ty. has_escaping_bound_vars( ) ) ;
12701268
12711269 traits:: elaborate_predicates ( tcx, predicates)
12721270 . filter_map ( |obligation| {
1271+ debug ! ( "required_region_bounds(obligation={:?})" , obligation) ;
12731272 match obligation. predicate {
12741273 ty:: Predicate :: Projection ( ..)
12751274 | ty:: Predicate :: Trait ( ..)
0 commit comments