aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_expand/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_expand/src/lib.rs')
-rw-r--r--crates/ra_hir_expand/src/lib.rs12
1 files changed, 1 insertions, 11 deletions
diff --git a/crates/ra_hir_expand/src/lib.rs b/crates/ra_hir_expand/src/lib.rs
index cf28de3d8..5a0e5a19c 100644
--- a/crates/ra_hir_expand/src/lib.rs
+++ b/crates/ra_hir_expand/src/lib.rs
@@ -8,6 +8,7 @@ pub mod db;
8pub mod ast_id_map; 8pub mod ast_id_map;
9pub mod either; 9pub mod either;
10pub mod name; 10pub mod name;
11pub mod hygiene;
11 12
12use std::hash::{Hash, Hasher}; 13use std::hash::{Hash, Hasher};
13 14
@@ -61,17 +62,6 @@ impl HirFileId {
61 } 62 }
62 } 63 }
63 } 64 }
64
65 /// Get the crate which the macro lives in, if it is a macro file.
66 pub fn macro_crate(self, db: &dyn db::AstDatabase) -> Option<CrateId> {
67 match self.0 {
68 HirFileIdRepr::FileId(_) => None,
69 HirFileIdRepr::MacroFile(macro_file) => {
70 let loc = db.lookup_intern_macro(macro_file.macro_call_id);
71 Some(loc.def.krate)
72 }
73 }
74 }
75} 65}
76 66
77#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] 67#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]