Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/infer/expr.rs')
-rw-r--r--crates/hir-ty/src/infer/expr.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/crates/hir-ty/src/infer/expr.rs b/crates/hir-ty/src/infer/expr.rs
index 89d92ea9af..b1c793a1e3 100644
--- a/crates/hir-ty/src/infer/expr.rs
+++ b/crates/hir-ty/src/infer/expr.rs
@@ -610,7 +610,12 @@ impl InferenceContext<'_> {
Expr::Cast { expr, type_ref } => {
let cast_ty = self.make_ty(type_ref);
let expr_ty = self.infer_expr(*expr, &Expectation::Castable(cast_ty.clone()));
- self.deferred_cast_checks.push(CastCheck::new(expr_ty, cast_ty.clone()));
+ self.deferred_cast_checks.push(CastCheck::new(
+ tgt_expr,
+ *expr,
+ expr_ty,
+ cast_ty.clone(),
+ ));
cast_ty
}
Expr::Ref { expr, rawness, mutability } => {