@@ -1175,8 +1175,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1175
1175
discrim_span : Option < Span > ,
1176
1176
) -> Ty < ' tcx > {
1177
1177
let tcx = self . tcx ;
1178
- let expected_ty = self . structurally_resolved_type ( span, expected) ;
1179
- let ( inner_ty, slice_ty) = match expected_ty . kind {
1178
+ let expected = self . structurally_resolved_type ( span, expected) ;
1179
+ let ( inner_ty, slice_ty) = match expected . kind {
1180
1180
// An array, so we might have something like `let [a, b, c] = [0, 1, 2];`.
1181
1181
ty:: Array ( inner_ty, size) => {
1182
1182
let slice_ty = if let Some ( size) = size. try_eval_usize ( tcx, self . param_env ) {
@@ -1208,11 +1208,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1208
1208
} ;
1209
1209
( inner_ty, slice_ty)
1210
1210
}
1211
- ty:: Slice ( inner_ty) => ( inner_ty, expected_ty ) ,
1211
+ ty:: Slice ( inner_ty) => ( inner_ty, expected ) ,
1212
1212
// The expected type must be an array or slice, but was neither, so error.
1213
1213
_ => {
1214
- if !expected_ty . references_error ( ) {
1215
- self . error_expected_array_or_slice ( span, expected_ty ) ;
1214
+ if !expected . references_error ( ) {
1215
+ self . error_expected_array_or_slice ( span, expected ) ;
1216
1216
}
1217
1217
( tcx. types . err , tcx. types . err )
1218
1218
}
@@ -1230,7 +1230,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1230
1230
for elt in after {
1231
1231
self . check_pat ( & elt, inner_ty, def_bm, discrim_span) ;
1232
1232
}
1233
- expected_ty
1233
+ expected
1234
1234
}
1235
1235
1236
1236
fn error_scrutinee_inconsistent_length ( & self , span : Span , min_len : u64 , size : u64 ) {
0 commit comments