diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-11-26 18:34:15 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-11-26 18:34:15 +0000 |
commit | 3206b83a70b4e9140a5f0d9d8454abb7864b543a (patch) | |
tree | 81c441643aebd07039ca08c80c905d77a28eb800 /crates/ra_hir/src | |
parent | 141fca60061d85494fcb719a4c8237eaf6c7c134 (diff) | |
parent | 447268ceac497432822e8cf28525a6784f392020 (diff) |
Merge #2418
2418: Hide MacroCallLoc outside hir_expand r=matklad a=edwin0cheng
This PR refactor `MacroCallLoc` such that it be hided to become implementation details of hir_expand.
Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r-- | crates/ra_hir/src/source_binder.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/crates/ra_hir/src/source_binder.rs b/crates/ra_hir/src/source_binder.rs index 82cb66583..7c4ebd4b4 100644 --- a/crates/ra_hir/src/source_binder.rs +++ b/crates/ra_hir/src/source_binder.rs | |||
@@ -14,8 +14,7 @@ use hir_def::{ | |||
14 | DefWithBodyId, | 14 | DefWithBodyId, |
15 | }; | 15 | }; |
16 | use hir_expand::{ | 16 | use hir_expand::{ |
17 | hygiene::Hygiene, name::AsName, AstId, HirFileId, MacroCallId, MacroCallLoc, MacroFileKind, | 17 | hygiene::Hygiene, name::AsName, AstId, HirFileId, MacroCallId, MacroFileKind, Source, |
18 | Source, | ||
19 | }; | 18 | }; |
20 | use ra_syntax::{ | 19 | use ra_syntax::{ |
21 | ast::{self, AstNode}, | 20 | ast::{self, AstNode}, |
@@ -451,9 +450,8 @@ impl SourceAnalyzer { | |||
451 | macro_call.file_id, | 450 | macro_call.file_id, |
452 | db.ast_id_map(macro_call.file_id).ast_id(macro_call.value), | 451 | db.ast_id_map(macro_call.file_id).ast_id(macro_call.value), |
453 | ); | 452 | ); |
454 | let macro_call_loc = MacroCallLoc { def, ast_id }; | ||
455 | Some(Expansion { | 453 | Some(Expansion { |
456 | macro_call_id: db.intern_macro(macro_call_loc), | 454 | macro_call_id: def.as_call_id(db, ast_id), |
457 | macro_file_kind: to_macro_file_kind(macro_call.value), | 455 | macro_file_kind: to_macro_file_kind(macro_call.value), |
458 | }) | 456 | }) |
459 | } | 457 | } |