@@ -37,7 +37,7 @@ use dep_graph::{DepNodeIndex, DepKind};
3737use hir:: def_id:: DefId ;
3838use infer;
3939use infer:: { InferCtxt , InferOk , TypeFreshener } ;
40- use ty:: subst:: { Kind , Subst , Substs } ;
40+ use ty:: subst:: { Subst , Substs } ;
4141use ty:: { self , ToPredicate , ToPolyTraitRef , Ty , TyCtxt , TypeFoldable } ;
4242use ty:: fast_reject;
4343use ty:: relate:: TypeRelation ;
@@ -3019,7 +3019,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
30193019 // with a potentially unsized trailing field.
30203020 let params = substs_a. iter ( ) . enumerate ( ) . map ( |( i, & k) | {
30213021 if ty_params. contains ( i) {
3022- Kind :: from ( tcx. types . err )
3022+ tcx. types . err . into ( )
30233023 } else {
30243024 k
30253025 }
@@ -3058,24 +3058,24 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
30583058 obligation. predicate . def_id ( ) ,
30593059 obligation. recursion_depth + 1 ,
30603060 inner_source,
3061- & [ inner_target] ) ) ;
3061+ & [ inner_target. into ( ) ] ) ) ;
30623062 }
30633063
30643064 // (.., T) -> (.., U).
30653065 ( & ty:: TyTuple ( tys_a) , & ty:: TyTuple ( tys_b) ) => {
30663066 assert_eq ! ( tys_a. len( ) , tys_b. len( ) ) ;
30673067
30683068 // The last field of the tuple has to exist.
3069- let ( a_last, a_mid) = if let Some ( x) = tys_a. split_last ( ) {
3069+ let ( & a_last, a_mid) = if let Some ( x) = tys_a. split_last ( ) {
30703070 x
30713071 } else {
30723072 return Err ( Unimplemented ) ;
30733073 } ;
3074- let b_last = tys_b. last ( ) . unwrap ( ) ;
3074+ let & b_last = tys_b. last ( ) . unwrap ( ) ;
30753075
30763076 // Check that the source tuple with the target's
30773077 // last element is equal to the target.
3078- let new_tuple = tcx. mk_tup ( a_mid. iter ( ) . chain ( Some ( b_last) ) ) ;
3078+ let new_tuple = tcx. mk_tup ( a_mid. iter ( ) . cloned ( ) . chain ( iter :: once ( b_last) ) ) ;
30793079 let InferOk { obligations, .. } =
30803080 self . infcx . at ( & obligation. cause , obligation. param_env )
30813081 . eq ( target, new_tuple)
@@ -3089,7 +3089,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
30893089 obligation. predicate . def_id ( ) ,
30903090 obligation. recursion_depth + 1 ,
30913091 a_last,
3092- & [ b_last] ) ) ;
3092+ & [ b_last. into ( ) ] ) ) ;
30933093 }
30943094
30953095 _ => bug ! ( )
0 commit comments