From 61ad6a96ad1019930294e754e72f627978e85787 Mon Sep 17 00:00:00 2001 From: hkalbasi Date: Sun, 19 Feb 2023 00:02:55 +0330 Subject: [PATCH] Add BindingId --- crates/hir-def/src/body.rs | 25 +++- crates/hir-def/src/body/lower.rs | 117 ++++++++++++------ crates/hir-def/src/body/pretty.rs | 23 ++-- crates/hir-def/src/body/scope.rs | 39 +++--- crates/hir-def/src/expr.rs | 12 +- crates/hir-def/src/resolver.rs | 14 +-- crates/hir-ty/src/consteval/tests.rs | 43 +++++++ crates/hir-ty/src/diagnostics/decl_check.rs | 4 +- crates/hir-ty/src/diagnostics/match_check.rs | 3 +- crates/hir-ty/src/infer.rs | 20 ++- crates/hir-ty/src/infer/pat.rs | 27 ++-- crates/hir-ty/src/infer/path.rs | 2 +- crates/hir-ty/src/layout/tests.rs | 12 +- crates/hir-ty/src/mir/lower.rs | 96 ++++++++++---- crates/hir/src/from_id.rs | 8 +- crates/hir/src/lib.rs | 99 +++++++++------ crates/hir/src/semantics.rs | 4 +- crates/hir/src/semantics/source_to_def.rs | 21 ++-- crates/hir/src/source_analyzer.rs | 8 +- .../src/handlers/convert_match_to_let_else.rs | 2 +- .../src/handlers/extract_function.rs | 25 ++-- .../src/handlers/inline_local_variable.rs | 11 +- crates/ide-db/src/rename.rs | 105 ++++++++-------- crates/ide-db/src/search.rs | 8 +- crates/ide/src/highlight_related.rs | 57 +++++---- crates/ide/src/hover/render.rs | 6 +- crates/ide/src/navigation_target.rs | 20 ++- 27 files changed, 514 insertions(+), 297 deletions(-) diff --git a/crates/hir-def/src/body.rs b/crates/hir-def/src/body.rs index 8fd9255b8b..545d2bebf5 100644 --- a/crates/hir-def/src/body.rs +++ b/crates/hir-def/src/body.rs @@ -24,7 +24,7 @@ use syntax::{ast, AstPtr, SyntaxNode, SyntaxNodePtr}; use crate::{ attr::Attrs, db::DefDatabase, - expr::{dummy_expr_id, Expr, ExprId, Label, LabelId, Pat, PatId}, + expr::{dummy_expr_id, Binding, BindingId, Expr, ExprId, Label, LabelId, Pat, PatId}, item_scope::BuiltinShadowMode, macro_id_to_def_id, nameres::DefMap, @@ -270,6 +270,7 @@ pub struct Mark { pub struct Body { pub exprs: Arena, pub pats: Arena, + pub bindings: Arena, pub or_pats: FxHashMap>, pub labels: Arena