@@ -2429,7 +2429,9 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
2429
2429
2430
2430
ty:: Str | ty:: Slice ( _) | ty:: Dynamic ( ..) | ty:: Foreign ( ..) => None ,
2431
2431
2432
- ty:: Tuple ( tys) => Where ( ty:: Binder :: bind ( tys. last ( ) . into_iter ( ) . cloned ( ) . collect ( ) ) ) ,
2432
+ ty:: Tuple ( tys) => {
2433
+ Where ( ty:: Binder :: bind ( tys. last ( ) . into_iter ( ) . map ( |k| k. expect_ty ( ) ) . collect ( ) ) )
2434
+ }
2433
2435
2434
2436
ty:: Adt ( def, substs) => {
2435
2437
let sized_crit = def. sized_constraint ( self . tcx ( ) ) ;
@@ -2503,7 +2505,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
2503
2505
2504
2506
ty:: Tuple ( tys) => {
2505
2507
// (*) binder moved here
2506
- Where ( ty:: Binder :: bind ( tys. to_vec ( ) ) )
2508
+ Where ( ty:: Binder :: bind ( tys. iter ( ) . map ( |k| k . expect_ty ( ) ) . collect ( ) ) )
2507
2509
}
2508
2510
2509
2511
ty:: Closure ( def_id, substs) => {
@@ -2590,7 +2592,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
2590
2592
2591
2593
ty:: Tuple ( ref tys) => {
2592
2594
// (T1, ..., Tn) -- meets any bound that all of T1...Tn meet
2593
- tys. to_vec ( )
2595
+ tys. iter ( ) . map ( |k| k . expect_ty ( ) ) . collect ( )
2594
2596
}
2595
2597
2596
2598
ty:: Closure ( def_id, ref substs) => substs. upvar_tys ( def_id, self . tcx ( ) ) . collect ( ) ,
@@ -3495,7 +3497,9 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
3495
3497
3496
3498
// Check that the source tuple with the target's
3497
3499
// last element is equal to the target.
3498
- let new_tuple = tcx. mk_tup ( a_mid. iter ( ) . cloned ( ) . chain ( iter:: once ( b_last) ) ) ;
3500
+ let new_tuple = tcx. mk_tup (
3501
+ a_mid. iter ( ) . map ( |k| k. expect_ty ( ) ) . chain ( iter:: once ( b_last. expect_ty ( ) ) ) ,
3502
+ ) ;
3499
3503
let InferOk { obligations, .. } = self . infcx
3500
3504
. at ( & obligation. cause , obligation. param_env )
3501
3505
. eq ( target, new_tuple)
@@ -3508,7 +3512,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
3508
3512
obligation. cause . clone ( ) ,
3509
3513
obligation. predicate . def_id ( ) ,
3510
3514
obligation. recursion_depth + 1 ,
3511
- a_last,
3515
+ a_last. expect_ty ( ) ,
3512
3516
& [ b_last. into ( ) ] ,
3513
3517
) ) ;
3514
3518
}
0 commit comments