@@ -42,7 +42,7 @@ use rustc::traits::query::type_op::custom::CustomTypeOp;
42
42
use rustc:: traits:: query:: { Fallible , NoSolution } ;
43
43
use rustc:: traits:: { ObligationCause , PredicateObligations } ;
44
44
use rustc:: ty:: fold:: TypeFoldable ;
45
- use rustc:: ty:: subst:: { Subst , UnpackedKind } ;
45
+ use rustc:: ty:: subst:: { Subst , Substs , UnpackedKind } ;
46
46
use rustc:: ty:: { self , RegionVid , ToPolyTraitRef , Ty , TyCtxt , TyKind } ;
47
47
use std:: rc:: Rc ;
48
48
use std:: { fmt, iter} ;
@@ -2075,12 +2075,9 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
2075
2075
// desugaring. A closure gets desugared to a struct, and
2076
2076
// these extra requirements are basically like where
2077
2077
// clauses on the struct.
2078
- AggregateKind :: Closure ( def_id, substs) => {
2079
- self . prove_closure_bounds ( tcx, * def_id, * substs, location)
2080
- }
2081
-
2082
- AggregateKind :: Generator ( def_id, substs, _) => {
2083
- tcx. predicates_of ( * def_id) . instantiate ( tcx, substs. substs )
2078
+ AggregateKind :: Closure ( def_id, ty:: ClosureSubsts { substs } )
2079
+ | AggregateKind :: Generator ( def_id, ty:: GeneratorSubsts { substs } , _) => {
2080
+ self . prove_closure_bounds ( tcx, * def_id, substs, location)
2084
2081
}
2085
2082
2086
2083
AggregateKind :: Array ( _) | AggregateKind :: Tuple => ty:: InstantiatedPredicates :: empty ( ) ,
@@ -2096,7 +2093,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
2096
2093
& mut self ,
2097
2094
tcx : TyCtxt < ' a , ' gcx , ' tcx > ,
2098
2095
def_id : DefId ,
2099
- substs : ty :: ClosureSubsts < ' tcx > ,
2096
+ substs : & ' tcx Substs < ' tcx > ,
2100
2097
location : Location ,
2101
2098
) -> ty:: InstantiatedPredicates < ' tcx > {
2102
2099
if let Some ( closure_region_requirements) =
@@ -2155,7 +2152,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
2155
2152
) ;
2156
2153
}
2157
2154
2158
- tcx. predicates_of ( def_id) . instantiate ( tcx, substs. substs )
2155
+ tcx. predicates_of ( def_id) . instantiate ( tcx, substs)
2159
2156
}
2160
2157
2161
2158
fn prove_trait_ref (
0 commit comments