@@ -201,7 +201,7 @@ enum SelectionCandidate<'tcx> {
201201
202202 /// Implementation of a `Fn`-family trait by one of the
203203 /// anonymous types generated for a `||` expression.
204- ClosureCandidate ( /* closure */ ast:: DefId , & ' tcx Substs < ' tcx > , & ' tcx Vec < Ty < ' tcx > > ) ,
204+ ClosureCandidate ( /* closure */ ast:: DefId , & ' tcx ty :: ClosureSubsts < ' tcx > ) ,
205205
206206 /// Implementation of a `Fn`-family trait by one of the anonymous
207207 /// types generated for a fn pointer type (e.g., `fn(int)->int`)
@@ -348,7 +348,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
348348 // lifetimes can appear inside the self-type.
349349 let self_ty = self . infcx . shallow_resolve ( * obligation. self_ty ( ) . skip_binder ( ) ) ;
350350 let ( closure_def_id, substs) = match self_ty. sty {
351- ty:: TyClosure ( id, ref substs, _ ) => ( id, substs. clone ( ) ) ,
351+ ty:: TyClosure ( id, ref substs) => ( id, substs) ,
352352 _ => { return ; }
353353 } ;
354354 assert ! ( !substs. has_escaping_regions( ) ) ;
@@ -1142,8 +1142,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
11421142 // touch bound regions, they just capture the in-scope
11431143 // type/region parameters
11441144 let self_ty = self . infcx . shallow_resolve ( * obligation. self_ty ( ) . skip_binder ( ) ) ;
1145- let ( closure_def_id, substs, upvar_tys ) = match self_ty. sty {
1146- ty:: TyClosure ( id, substs , ref upvar_tys ) => ( id, substs, upvar_tys ) ,
1145+ let ( closure_def_id, substs) = match self_ty. sty {
1146+ ty:: TyClosure ( id, ref substs ) => ( id, substs) ,
11471147 ty:: TyInfer ( ty:: TyVar ( _) ) => {
11481148 debug ! ( "assemble_unboxed_closure_candidates: ambiguous self-type" ) ;
11491149 candidates. ambiguous = true ;
@@ -1161,7 +1161,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
11611161 Some ( closure_kind) => {
11621162 debug ! ( "assemble_unboxed_candidates: closure_kind = {:?}" , closure_kind) ;
11631163 if closure_kind. extends ( kind) {
1164- candidates. vec . push ( ClosureCandidate ( closure_def_id, substs, upvar_tys ) ) ;
1164+ candidates. vec . push ( ClosureCandidate ( closure_def_id, substs) ) ;
11651165 }
11661166 }
11671167 None => {
@@ -1703,7 +1703,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
17031703 // (T1, ..., Tn) -- meets any bound that all of T1...Tn meet
17041704 ty:: TyTuple ( ref tys) => ok_if ( tys. clone ( ) ) ,
17051705
1706- ty:: TyClosure ( def_id, substs , _ ) => {
1706+ ty:: TyClosure ( def_id, ref substs ) => {
17071707 // FIXME -- This case is tricky. In the case of by-ref
17081708 // closures particularly, we need the results of
17091709 // inference to decide how to reflect the type of each
@@ -1865,7 +1865,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
18651865 Some ( tys. clone ( ) )
18661866 }
18671867
1868- ty:: TyClosure ( def_id, substs , _ ) => {
1868+ ty:: TyClosure ( def_id, ref substs ) => {
18691869 assert_eq ! ( def_id. krate, ast:: LOCAL_CRATE ) ;
18701870
18711871 // TODO
@@ -2015,10 +2015,9 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
20152015 Ok ( VtableImpl ( vtable_impl) )
20162016 }
20172017
2018- ClosureCandidate ( closure_def_id, substs, upvar_tys ) => {
2018+ ClosureCandidate ( closure_def_id, substs) => {
20192019 let vtable_closure =
2020- try!( self . confirm_closure_candidate ( obligation, closure_def_id,
2021- & substs, upvar_tys) ) ;
2020+ try!( self . confirm_closure_candidate ( obligation, closure_def_id, substs) ) ;
20222021 Ok ( VtableClosure ( vtable_closure) )
20232022 }
20242023
@@ -2367,8 +2366,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
23672366 fn confirm_closure_candidate ( & mut self ,
23682367 obligation : & TraitObligation < ' tcx > ,
23692368 closure_def_id : ast:: DefId ,
2370- substs : & Substs < ' tcx > ,
2371- upvar_tys : & ' tcx Vec < Ty < ' tcx > > )
2369+ substs : & ty:: ClosureSubsts < ' tcx > )
23722370 -> Result < VtableClosureData < ' tcx , PredicateObligation < ' tcx > > ,
23732371 SelectionError < ' tcx > >
23742372 {
@@ -2394,7 +2392,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
23942392 Ok ( VtableClosureData {
23952393 closure_def_id : closure_def_id,
23962394 substs : substs. clone ( ) ,
2397- upvar_tys : upvar_tys. clone ( ) ,
23982395 nested : obligations
23992396 } )
24002397 }
@@ -2856,7 +2853,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
28562853 fn closure_trait_ref_unnormalized ( & mut self ,
28572854 obligation : & TraitObligation < ' tcx > ,
28582855 closure_def_id : ast:: DefId ,
2859- substs : & Substs < ' tcx > )
2856+ substs : & ty :: ClosureSubsts < ' tcx > )
28602857 -> ty:: PolyTraitRef < ' tcx >
28612858 {
28622859 let closure_type = self . infcx . closure_type ( closure_def_id, substs) ;
@@ -2878,7 +2875,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
28782875 fn closure_trait_ref ( & mut self ,
28792876 obligation : & TraitObligation < ' tcx > ,
28802877 closure_def_id : ast:: DefId ,
2881- substs : & Substs < ' tcx > )
2878+ substs : & ty :: ClosureSubsts < ' tcx > )
28822879 -> Normalized < ' tcx , ty:: PolyTraitRef < ' tcx > >
28832880 {
28842881 let trait_ref = self . closure_trait_ref_unnormalized (
0 commit comments