@@ -2429,7 +2429,9 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
24292429
24302430 ty:: Str | ty:: Slice ( _) | ty:: Dynamic ( ..) | ty:: Foreign ( ..) => None ,
24312431
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+ }
24332435
24342436 ty:: Adt ( def, substs) => {
24352437 let sized_crit = def. sized_constraint ( self . tcx ( ) ) ;
@@ -2503,7 +2505,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
25032505
25042506 ty:: Tuple ( tys) => {
25052507 // (*) binder moved here
2506- Where ( ty:: Binder :: bind ( tys. to_vec ( ) ) )
2508+ Where ( ty:: Binder :: bind ( tys. iter ( ) . map ( |k| k . expect_ty ( ) ) . collect ( ) ) )
25072509 }
25082510
25092511 ty:: Closure ( def_id, substs) => {
@@ -2590,7 +2592,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
25902592
25912593 ty:: Tuple ( ref tys) => {
25922594 // (T1, ..., Tn) -- meets any bound that all of T1...Tn meet
2593- tys. to_vec ( )
2595+ tys. iter ( ) . map ( |k| k . expect_ty ( ) ) . collect ( )
25942596 }
25952597
25962598 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> {
34953497
34963498 // Check that the source tuple with the target's
34973499 // 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+ ) ;
34993503 let InferOk { obligations, .. } = self . infcx
35003504 . at ( & obligation. cause , obligation. param_env )
35013505 . eq ( target, new_tuple)
@@ -3508,7 +3512,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
35083512 obligation. cause . clone ( ) ,
35093513 obligation. predicate . def_id ( ) ,
35103514 obligation. recursion_depth + 1 ,
3511- a_last,
3515+ a_last. expect_ty ( ) ,
35123516 & [ b_last. into ( ) ] ,
35133517 ) ) ;
35143518 }
0 commit comments