diff options
Diffstat (limited to 'crates/hir_ty/src/infer')
-rw-r--r-- | crates/hir_ty/src/infer/expr.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/hir_ty/src/infer/expr.rs b/crates/hir_ty/src/infer/expr.rs index 9bf3b51b0..d7351d212 100644 --- a/crates/hir_ty/src/infer/expr.rs +++ b/crates/hir_ty/src/infer/expr.rs | |||
@@ -491,7 +491,10 @@ impl<'a> InferenceContext<'a> { | |||
491 | Expr::Box { expr } => { | 491 | Expr::Box { expr } => { |
492 | let inner_ty = self.infer_expr_inner(*expr, &Expectation::none()); | 492 | let inner_ty = self.infer_expr_inner(*expr, &Expectation::none()); |
493 | if let Some(box_) = self.resolve_boxed_box() { | 493 | if let Some(box_) = self.resolve_boxed_box() { |
494 | Ty::apply_one(TypeCtor::Adt(box_), inner_ty) | 494 | let mut sb = Substs::build_for_type_ctor(self.db, TypeCtor::Adt(box_)); |
495 | sb = sb.push(inner_ty); | ||
496 | sb = sb.fill(repeat_with(|| self.table.new_type_var())); | ||
497 | Ty::apply(TypeCtor::Adt(box_), sb.build()) | ||
495 | } else { | 498 | } else { |
496 | Ty::Unknown | 499 | Ty::Unknown |
497 | } | 500 | } |