aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-10-29 13:01:14 +0000
committerAleksey Kladov <[email protected]>2019-10-29 13:01:14 +0000
commit7de6eaa58ae994a5c5d39a66253e347fb039fa94 (patch)
tree20b346ced3beb9572574d2e7590b0ce26ead2461 /crates/ra_hir
parentb8b7969bfb261fa86b4c38024f873444145fe7a2 (diff)
remove not that useful indirection
Diffstat (limited to 'crates/ra_hir')
-rw-r--r--crates/ra_hir/src/expr/lower.rs2
-rw-r--r--crates/ra_hir/src/impl_block.rs2
-rw-r--r--crates/ra_hir/src/nameres/collector.rs4
3 files changed, 4 insertions, 4 deletions
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
465 465
466 if let Some(path) = e.path().and_then(|path| self.parse_path(path)) { 466 if let Some(path) = e.path().and_then(|path| self.parse_path(path)) {
467 if let Some(def) = self.resolver.resolve_path_as_macro(self.db, &path) { 467 if let Some(def) = self.resolver.resolve_path_as_macro(self.db, &path) {
468 let call_id = MacroCallLoc { def: def.id, ast_id }.id(self.db); 468 let call_id = self.db.intern_macro(MacroCallLoc { def: def.id, ast_id });
469 let file_id = call_id.as_file(MacroFileKind::Expr); 469 let file_id = call_id.as_file(MacroFileKind::Expr);
470 if let Some(node) = self.db.parse_or_expand(file_id) { 470 if let Some(node) = self.db.parse_or_expand(file_id) {
471 if let Some(expr) = ast::Expr::cast(node) { 471 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 {
263 { 263 {
264 if let Some(def) = self.module.resolver(db).resolve_path_as_macro(db, &path) 264 if let Some(def) = self.module.resolver(db).resolve_path_as_macro(db, &path)
265 { 265 {
266 let call_id = MacroCallLoc { def: def.id, ast_id }.id(db); 266 let call_id = db.intern_macro(MacroCallLoc { def: def.id, ast_id });
267 let file_id = call_id.as_file(MacroFileKind::Items); 267 let file_id = call_id.as_file(MacroFileKind::Items);
268 if let Some(item_list) = 268 if let Some(item_list) =
269 db.parse_or_expand(file_id).and_then(ast::MacroItems::cast) 269 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
448 ); 448 );
449 449
450 if let Some(def) = resolved_res.resolved_def.get_macros() { 450 if let Some(def) = resolved_res.resolved_def.get_macros() {
451 let call_id = MacroCallLoc { def: def.id, ast_id: *ast_id }.id(self.db); 451 let call_id = self.db.intern_macro(MacroCallLoc { def: def.id, ast_id: *ast_id });
452 resolved.push((*module_id, call_id, def.id)); 452 resolved.push((*module_id, call_id, def.id));
453 res = ReachedFixedPoint::No; 453 res = ReachedFixedPoint::No;
454 return false; 454 return false;
@@ -690,7 +690,7 @@ where
690 self.def_collector.def_map[self.module_id].scope.get_legacy_macro(&name) 690 self.def_collector.def_map[self.module_id].scope.get_legacy_macro(&name)
691 }) { 691 }) {
692 let def = macro_def.id; 692 let def = macro_def.id;
693 let macro_call_id = MacroCallLoc { def, ast_id }.id(self.def_collector.db); 693 let macro_call_id = self.def_collector.db.intern_macro(MacroCallLoc { def, ast_id });
694 694
695 self.def_collector.collect_macro_expansion(self.module_id, macro_call_id, def); 695 self.def_collector.collect_macro_expansion(self.module_id, macro_call_id, def);
696 return; 696 return;