@@ -37,7 +37,7 @@ use dep_graph::{DepNodeIndex, DepKind};
37
37
use hir:: def_id:: DefId ;
38
38
use infer;
39
39
use infer:: { InferCtxt , InferOk , TypeFreshener } ;
40
- use ty:: subst:: { Kind , Subst , Substs } ;
40
+ use ty:: subst:: { Subst , Substs } ;
41
41
use ty:: { self , ToPredicate , ToPolyTraitRef , Ty , TyCtxt , TypeFoldable } ;
42
42
use ty:: fast_reject;
43
43
use ty:: relate:: TypeRelation ;
@@ -3019,7 +3019,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
3019
3019
// with a potentially unsized trailing field.
3020
3020
let params = substs_a. iter ( ) . enumerate ( ) . map ( |( i, & k) | {
3021
3021
if ty_params. contains ( i) {
3022
- Kind :: from ( tcx. types . err )
3022
+ tcx. types . err . into ( )
3023
3023
} else {
3024
3024
k
3025
3025
}
@@ -3058,24 +3058,24 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
3058
3058
obligation. predicate . def_id ( ) ,
3059
3059
obligation. recursion_depth + 1 ,
3060
3060
inner_source,
3061
- & [ inner_target] ) ) ;
3061
+ & [ inner_target. into ( ) ] ) ) ;
3062
3062
}
3063
3063
3064
3064
// (.., T) -> (.., U).
3065
3065
( & ty:: TyTuple ( tys_a) , & ty:: TyTuple ( tys_b) ) => {
3066
3066
assert_eq ! ( tys_a. len( ) , tys_b. len( ) ) ;
3067
3067
3068
3068
// 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 ( ) {
3070
3070
x
3071
3071
} else {
3072
3072
return Err ( Unimplemented ) ;
3073
3073
} ;
3074
- let b_last = tys_b. last ( ) . unwrap ( ) ;
3074
+ let & b_last = tys_b. last ( ) . unwrap ( ) ;
3075
3075
3076
3076
// Check that the source tuple with the target's
3077
3077
// 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) ) ) ;
3079
3079
let InferOk { obligations, .. } =
3080
3080
self . infcx . at ( & obligation. cause , obligation. param_env )
3081
3081
. eq ( target, new_tuple)
@@ -3089,7 +3089,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
3089
3089
obligation. predicate . def_id ( ) ,
3090
3090
obligation. recursion_depth + 1 ,
3091
3091
a_last,
3092
- & [ b_last] ) ) ;
3092
+ & [ b_last. into ( ) ] ) ) ;
3093
3093
}
3094
3094
3095
3095
_ => bug ! ( )
0 commit comments