Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/infer/pat.rs')
| -rw-r--r-- | crates/hir-ty/src/infer/pat.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/hir-ty/src/infer/pat.rs b/crates/hir-ty/src/infer/pat.rs index 50542b2acd..fee6755408 100644 --- a/crates/hir-ty/src/infer/pat.rs +++ b/crates/hir-ty/src/infer/pat.rs @@ -12,7 +12,7 @@ use stdx::TupleExt; use crate::{ consteval::{try_const_usize, usize_const}, - infer::{BindingMode, Expectation, InferenceContext, TypeMismatch}, + infer::{expr::ExprIsRead, BindingMode, Expectation, InferenceContext, TypeMismatch}, lower::lower_to_chalk_mutability, primitive::UintTy, static_lifetime, InferenceDiagnostic, Interner, Mutability, Scalar, Substitution, Ty, @@ -361,7 +361,7 @@ impl InferenceContext<'_> { None => self.err_ty(), }, Pat::ConstBlock(expr) => { - self.infer_expr(*expr, &Expectation::has_type(expected.clone())) + self.infer_expr(*expr, &Expectation::has_type(expected.clone()), ExprIsRead::Yes) } Pat::Missing => self.err_ty(), }; @@ -497,7 +497,7 @@ impl InferenceContext<'_> { } } - self.infer_expr(expr, &Expectation::has_type(expected.clone())) + self.infer_expr(expr, &Expectation::has_type(expected.clone()), ExprIsRead::Yes) } fn is_non_ref_pat(&mut self, body: &hir_def::body::Body, pat: PatId) -> bool { |