From 7de6eaa58ae994a5c5d39a66253e347fb039fa94 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 29 Oct 2019 16:01:14 +0300 Subject: remove not that useful indirection --- crates/ra_hir/src/expr/lower.rs | 2 +- crates/ra_hir/src/impl_block.rs | 2 +- crates/ra_hir/src/nameres/collector.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/ra_hir/src') diff --git a/crates/ra_hir/src/expr/lower.rs b/crates/ra_hir/src/expr/lower.rs index 24733b3de..b3a9a2e6b 100644 --- a/crates/ra_hir/src/expr/lower.rs +++ b/crates/ra_hir/src/expr/lower.rs @@ -465,7 +465,7 @@ where if let Some(path) = e.path().and_then(|path| self.parse_path(path)) { if let Some(def) = self.resolver.resolve_path_as_macro(self.db, &path) { - let call_id = MacroCallLoc { def: def.id, ast_id }.id(self.db); + let call_id = self.db.intern_macro(MacroCallLoc { def: def.id, ast_id }); let file_id = call_id.as_file(MacroFileKind::Expr); if let Some(node) = self.db.parse_or_expand(file_id) { if let Some(expr) = ast::Expr::cast(node) { diff --git a/crates/ra_hir/src/impl_block.rs b/crates/ra_hir/src/impl_block.rs index 9c739f3f1..1a5223680 100644 --- a/crates/ra_hir/src/impl_block.rs +++ b/crates/ra_hir/src/impl_block.rs @@ -263,7 +263,7 @@ impl ModuleImplBlocks { { if let Some(def) = self.module.resolver(db).resolve_path_as_macro(db, &path) { - let call_id = MacroCallLoc { def: def.id, ast_id }.id(db); + let call_id = db.intern_macro(MacroCallLoc { def: def.id, ast_id }); let file_id = call_id.as_file(MacroFileKind::Items); if let Some(item_list) = db.parse_or_expand(file_id).and_then(ast::MacroItems::cast) diff --git a/crates/ra_hir/src/nameres/collector.rs b/crates/ra_hir/src/nameres/collector.rs index 885ea57a1..dc591e8d3 100644 --- a/crates/ra_hir/src/nameres/collector.rs +++ b/crates/ra_hir/src/nameres/collector.rs @@ -448,7 +448,7 @@ where ); if let Some(def) = resolved_res.resolved_def.get_macros() { - let call_id = MacroCallLoc { def: def.id, ast_id: *ast_id }.id(self.db); + let call_id = self.db.intern_macro(MacroCallLoc { def: def.id, ast_id: *ast_id }); resolved.push((*module_id, call_id, def.id)); res = ReachedFixedPoint::No; return false; @@ -690,7 +690,7 @@ where self.def_collector.def_map[self.module_id].scope.get_legacy_macro(&name) }) { let def = macro_def.id; - let macro_call_id = MacroCallLoc { def, ast_id }.id(self.def_collector.db); + let macro_call_id = self.def_collector.db.intern_macro(MacroCallLoc { def, ast_id }); self.def_collector.collect_macro_expansion(self.module_id, macro_call_id, def); return; -- cgit v1.2.3