@@ -2753,7 +2753,8 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
2753
2753
}
2754
2754
2755
2755
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
2757
2758
{
2758
2759
let ty_var_root = self . root_var ( self_ty) ;
2759
2760
debug ! ( "obligations_for_self_ty: self_ty={:?} ty_var_root={:?} pending_obligations={:?}" ,
@@ -2765,8 +2766,10 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
2765
2766
. pending_obligations ( )
2766
2767
. into_iter ( )
2767
2768
. 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) ) ,
2770
2773
ty:: Predicate :: Subtype ( ..) => None ,
2771
2774
ty:: Predicate :: RegionOutlives ( ..) => None ,
2772
2775
ty:: Predicate :: TypeOutlives ( ..) => None ,
@@ -2782,11 +2785,11 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
2782
2785
// code is looking for a self type of a unresolved
2783
2786
// inference variable.
2784
2787
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) )
2786
2789
}
2787
2790
2788
2791
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 , _ ) | {
2790
2793
Some ( tr. def_id ( ) ) == self . tcx . lang_items ( ) . sized_trait ( )
2791
2794
} )
2792
2795
}
0 commit comments