Unnamed repository; edit this file 'description' to name the repository.
Relate the bindings `lower_coroutine_body_with_moved_arguments()` creates with their pattern
Chayim Refael Friedman 3 weeks ago
parent be55930 · commit ac8bbe8
-rw-r--r--crates/hir-def/src/expr_store/lower.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/crates/hir-def/src/expr_store/lower.rs b/crates/hir-def/src/expr_store/lower.rs
index 05dfe80d10..a9697d8e72 100644
--- a/crates/hir-def/src/expr_store/lower.rs
+++ b/crates/hir-def/src/expr_store/lower.rs
@@ -1017,6 +1017,7 @@ impl<'db> ExprCollector<'db> {
self.alloc_binding(name.clone(), BindingAnnotation::Mutable, hygiene);
let child_pat_id =
self.alloc_pat_desugared(Pat::Bind { id: child_binding_id, subpat: None });
+ self.add_definition_to_binding(child_binding_id, child_pat_id);
let expr = self.alloc_expr_desugared(Expr::Path(name.clone().into()));
if !hygiene.is_root() {
self.store.ident_hygiene.insert(expr.into(), hygiene);
@@ -1043,6 +1044,7 @@ impl<'db> ExprCollector<'db> {
self.alloc_binding(name.clone(), BindingAnnotation::Mutable, hygiene);
let parent_pat_id =
self.alloc_pat_desugared(Pat::Bind { id: parent_binding_id, subpat: None });
+ self.add_definition_to_binding(parent_binding_id, parent_pat_id);
*param = parent_pat_id;
}
}