Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/infer.rs')
| -rw-r--r-- | crates/hir-ty/src/infer.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/crates/hir-ty/src/infer.rs b/crates/hir-ty/src/infer.rs index 4b80f06a3a..ecadfb6ce4 100644 --- a/crates/hir-ty/src/infer.rs +++ b/crates/hir-ty/src/infer.rs @@ -137,6 +137,14 @@ trait PatLike: Into<ExprOrPatId> + Copy { ) -> Ty; } +impl PatLike for ExprId { + type BindingMode = (); + + fn infer(this: &mut InferenceContext, id: Self, expected_ty: &Ty, _: Self::BindingMode) -> Ty { + this.infer_assignee_expr(id, expected_ty) + } +} + impl PatLike for PatId { type BindingMode = BindingMode; |