@@ -982,7 +982,7 @@ impl<'a, 'gcx, 'tcx> Generics {
982982#[ derive( Clone , Default ) ]
983983pub struct GenericPredicates < ' tcx > {
984984 pub parent : Option < DefId > ,
985- pub predicates : Vec < Predicate < ' tcx > > ,
985+ pub predicates : Vec < ( Predicate < ' tcx > , Span ) > ,
986986}
987987
988988impl < ' tcx > serialize:: UseSpecializedEncodable for GenericPredicates < ' tcx > { }
@@ -998,7 +998,7 @@ impl<'a, 'gcx, 'tcx> GenericPredicates<'tcx> {
998998 pub fn instantiate_own ( & self , tcx : TyCtxt < ' a , ' gcx , ' tcx > , substs : & Substs < ' tcx > )
999999 -> InstantiatedPredicates < ' tcx > {
10001000 InstantiatedPredicates {
1001- predicates : self . predicates . subst ( tcx, substs)
1001+ predicates : self . predicates . iter ( ) . map ( | ( p , _ ) | p . subst ( tcx, substs) ) . collect ( ) ,
10021002 }
10031003 }
10041004
@@ -1008,7 +1008,9 @@ impl<'a, 'gcx, 'tcx> GenericPredicates<'tcx> {
10081008 if let Some ( def_id) = self . parent {
10091009 tcx. predicates_of ( def_id) . instantiate_into ( tcx, instantiated, substs) ;
10101010 }
1011- instantiated. predicates . extend ( self . predicates . iter ( ) . map ( |p| p. subst ( tcx, substs) ) )
1011+ instantiated. predicates . extend (
1012+ self . predicates . iter ( ) . map ( |( p, _) | p. subst ( tcx, substs) ) ,
1013+ ) ;
10121014 }
10131015
10141016 pub fn instantiate_identity ( & self , tcx : TyCtxt < ' a , ' gcx , ' tcx > )
@@ -1023,7 +1025,7 @@ impl<'a, 'gcx, 'tcx> GenericPredicates<'tcx> {
10231025 if let Some ( def_id) = self . parent {
10241026 tcx. predicates_of ( def_id) . instantiate_identity_into ( tcx, instantiated) ;
10251027 }
1026- instantiated. predicates . extend ( & self . predicates )
1028+ instantiated. predicates . extend ( self . predicates . iter ( ) . map ( | & ( p , _ ) | p ) )
10271029 }
10281030
10291031 pub fn instantiate_supertrait ( & self , tcx : TyCtxt < ' a , ' gcx , ' tcx > ,
@@ -1032,7 +1034,7 @@ impl<'a, 'gcx, 'tcx> GenericPredicates<'tcx> {
10321034 {
10331035 assert_eq ! ( self . parent, None ) ;
10341036 InstantiatedPredicates {
1035- predicates : self . predicates . iter ( ) . map ( |pred| {
1037+ predicates : self . predicates . iter ( ) . map ( |( pred, _ ) | {
10361038 pred. subst_supertrait ( tcx, poly_trait_ref)
10371039 } ) . collect ( )
10381040 }
@@ -2351,7 +2353,7 @@ impl<'a, 'gcx, 'tcx> AdtDef {
23512353 substs : tcx. mk_substs_trait ( ty, & [ ] )
23522354 } ) . to_predicate ( ) ;
23532355 let predicates = tcx. predicates_of ( self . did ) . predicates ;
2354- if predicates. into_iter ( ) . any ( |p | p == sized_predicate) {
2356+ if predicates. into_iter ( ) . any ( |( p , _ ) | p == sized_predicate) {
23552357 vec ! [ ]
23562358 } else {
23572359 vec ! [ ty]
0 commit comments