@@ -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 {
@@ -1127,7 +1127,8 @@ impl<'a, 'tcx> Instantiator<'a, 'tcx> {
11271127
11281128 debug ! ( "instantiate_opaque_types: bounds={:?}" , bounds) ;
11291129
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 ( ) ) ;
11311132 debug ! ( "instantiate_opaque_types: required_region_bounds={:?}" , required_region_bounds) ;
11321133
11331134 // 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
12451246crate fn required_region_bounds (
12461247 tcx : TyCtxt < ' tcx > ,
12471248 erased_self_ty : Ty < ' tcx > ,
1248- predicates : Vec < ty:: Predicate < ' tcx > > ,
1249+ predicates : impl Iterator < Item = ty:: Predicate < ' tcx > > ,
12491250) -> 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) ;
12541252
12551253 assert ! ( !erased_self_ty. has_escaping_bound_vars( ) ) ;
12561254
12571255 traits:: elaborate_predicates ( tcx, predicates)
12581256 . filter_map ( |obligation| {
1257+ debug ! ( "required_region_bounds(obligation={:?})" , obligation) ;
12591258 match obligation. predicate {
12601259 ty:: Predicate :: Projection ( ..)
12611260 | ty:: Predicate :: Trait ( ..)
0 commit comments