@@ -2051,7 +2051,10 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
2051
2051
"assemble_unboxed_candidates: kind={:?} obligation={:?}" ,
2052
2052
kind, obligation
2053
2053
) ;
2054
- match self . infcx . closure_kind ( closure_def_id, closure_substs) {
2054
+ match self . infcx . closure_kind (
2055
+ closure_def_id,
2056
+ closure_substs
2057
+ ) {
2055
2058
Some ( closure_kind) => {
2056
2059
debug ! (
2057
2060
"assemble_unboxed_candidates: closure_kind = {:?}" ,
@@ -2669,7 +2672,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
2669
2672
ty:: Closure ( def_id, substs) => {
2670
2673
// (*) binder moved here
2671
2674
Where ( ty:: Binder :: bind (
2672
- substs. upvar_tys ( def_id, self . tcx ( ) ) . collect ( ) ,
2675
+ substs. as_closure ( ) . upvar_tys ( def_id, self . tcx ( ) ) . collect ( ) ,
2673
2676
) )
2674
2677
}
2675
2678
@@ -2753,7 +2756,9 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
2753
2756
tys. iter ( ) . map ( |k| k. expect_ty ( ) ) . collect ( )
2754
2757
}
2755
2758
2756
- ty:: Closure ( def_id, ref substs) => substs. upvar_tys ( def_id, self . tcx ( ) ) . collect ( ) ,
2759
+ ty:: Closure ( def_id, ref substs) => substs. as_closure ( )
2760
+ . upvar_tys ( def_id, self . tcx ( ) )
2761
+ . collect ( ) ,
2757
2762
2758
2763
ty:: Generator ( def_id, ref substs, _) => {
2759
2764
let witness = substs. witness ( def_id, self . tcx ( ) ) ;
@@ -3370,17 +3375,22 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
3370
3375
) ?) ;
3371
3376
3372
3377
// FIXME: chalk
3378
+
3373
3379
if !self . tcx ( ) . sess . opts . debugging_opts . chalk {
3374
3380
obligations. push ( Obligation :: new (
3375
3381
obligation. cause . clone ( ) ,
3376
3382
obligation. param_env ,
3377
- ty:: Predicate :: ClosureKind ( closure_def_id, substs, kind) ,
3383
+ ty:: Predicate :: ClosureKind (
3384
+ closure_def_id,
3385
+ substs,
3386
+ kind
3387
+ ) ,
3378
3388
) ) ;
3379
3389
}
3380
3390
3381
3391
Ok ( VtableClosureData {
3382
3392
closure_def_id,
3383
- substs : substs. clone ( ) ,
3393
+ substs : substs,
3384
3394
nested : obligations,
3385
3395
} )
3386
3396
}
@@ -3869,7 +3879,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
3869
3879
& mut self ,
3870
3880
obligation : & TraitObligation < ' tcx > ,
3871
3881
closure_def_id : DefId ,
3872
- substs : ty :: ClosureSubsts < ' tcx > ,
3882
+ substs : SubstsRef < ' tcx > ,
3873
3883
) -> ty:: PolyTraitRef < ' tcx > {
3874
3884
debug ! (
3875
3885
"closure_trait_ref_unnormalized(obligation={:?}, closure_def_id={:?}, substs={:?})" ,
0 commit comments