diff options
-rw-r--r-- | crates/ra_hir/src/ty.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_hir/src/ty.rs b/crates/ra_hir/src/ty.rs index d3373644d..55373b05a 100644 --- a/crates/ra_hir/src/ty.rs +++ b/crates/ra_hir/src/ty.rs | |||
@@ -1107,13 +1107,13 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
1107 | Ty::Tuple(Arc::from(ty_vec)) | 1107 | Ty::Tuple(Arc::from(ty_vec)) |
1108 | }, | 1108 | }, |
1109 | Expr::Array { exprs } => { | 1109 | Expr::Array { exprs } => { |
1110 | let mut elem_ty = match &expected.ty { | 1110 | let elem_ty = match &expected.ty { |
1111 | Ty::Slice(inner) | Ty::Array(inner) => Ty::clone(&inner), | 1111 | Ty::Slice(inner) | Ty::Array(inner) => Ty::clone(&inner), |
1112 | _ => self.new_type_var(), | 1112 | _ => self.new_type_var(), |
1113 | }; | 1113 | }; |
1114 | 1114 | ||
1115 | for expr in exprs.iter() { | 1115 | for expr in exprs.iter() { |
1116 | elem_ty = self.infer_expr(*expr, &Expectation::has_type(elem_ty.clone())); | 1116 | self.infer_expr(*expr, &Expectation::has_type(elem_ty.clone())); |
1117 | } | 1117 | } |
1118 | 1118 | ||
1119 | Ty::Array(Arc::new(elem_ty)) | 1119 | Ty::Array(Arc::new(elem_ty)) |