@@ -2753,7 +2753,8 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
27532753 }
27542754
27552755 fn obligations_for_self_ty < ' b > ( & ' b self , self_ty : ty:: TyVid )
2756- -> impl Iterator < Item =ty:: PolyTraitRef < ' tcx > > + Captures < ' gcx > + ' b
2756+ -> impl Iterator < Item =( ty:: PolyTraitRef < ' tcx > , traits:: PredicateObligation < ' tcx > ) >
2757+ + Captures < ' gcx > + ' b
27572758 {
27582759 let ty_var_root = self . root_var ( self_ty) ;
27592760 debug ! ( "obligations_for_self_ty: self_ty={:?} ty_var_root={:?} pending_obligations={:?}" ,
@@ -2765,8 +2766,10 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
27652766 . pending_obligations ( )
27662767 . into_iter ( )
27672768 . filter_map ( move |obligation| match obligation. predicate {
2768- ty:: Predicate :: Projection ( ref data) => Some ( data. to_poly_trait_ref ( self . tcx ) ) ,
2769- ty:: Predicate :: Trait ( ref data) => Some ( data. to_poly_trait_ref ( ) ) ,
2769+ ty:: Predicate :: Projection ( ref data) =>
2770+ Some ( ( data. to_poly_trait_ref ( self . tcx ) , obligation) ) ,
2771+ ty:: Predicate :: Trait ( ref data) =>
2772+ Some ( ( data. to_poly_trait_ref ( ) , obligation) ) ,
27702773 ty:: Predicate :: Subtype ( ..) => None ,
27712774 ty:: Predicate :: RegionOutlives ( ..) => None ,
27722775 ty:: Predicate :: TypeOutlives ( ..) => None ,
@@ -2782,11 +2785,11 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
27822785 // code is looking for a self type of a unresolved
27832786 // inference variable.
27842787 ty:: Predicate :: ClosureKind ( ..) => None ,
2785- } ) . filter ( move |tr | self . self_type_matches_expected_vid ( * tr, ty_var_root) )
2788+ } ) . filter ( move |( tr , _ ) | self . self_type_matches_expected_vid ( * tr, ty_var_root) )
27862789 }
27872790
27882791 fn type_var_is_sized ( & self , self_ty : ty:: TyVid ) -> bool {
2789- self . obligations_for_self_ty ( self_ty) . any ( |tr | {
2792+ self . obligations_for_self_ty ( self_ty) . any ( |( tr , _ ) | {
27902793 Some ( tr. def_id ( ) ) == self . tcx . lang_items ( ) . sized_trait ( )
27912794 } )
27922795 }
0 commit comments