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.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/crates/hir_ty/src/infer/expr.rs b/crates/hir_ty/src/infer/expr.rs index a892a680d7..54b1680214 100644 --- a/crates/hir_ty/src/infer/expr.rs +++ b/crates/hir_ty/src/infer/expr.rs @@ -799,8 +799,15 @@ impl<'a> InferenceContext<'a> { ), ); - let repeat_expr = &self.body.exprs[repeat]; - consteval::eval_usize(repeat_expr) + consteval::eval_usize( + repeat, + consteval::ConstEvalCtx { + exprs: &body.exprs, + pats: &body.pats, + local_data: Default::default(), + infer: &mut |x| self.infer_expr(x, &expected), + }, + ) } }; |