diff options
author | Aleksey Kladov <[email protected]> | 2019-11-24 11:13:51 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-11-24 11:13:51 +0000 |
commit | 53506a755220557a558be4da244b70d79f5b0fa9 (patch) | |
tree | 0781995393812f583200929cea61c706290ee137 /crates/ra_hir_def | |
parent | f11237561c391eecba39c5ba57defa2dc7a27b21 (diff) |
Pull macro up
Diffstat (limited to 'crates/ra_hir_def')
-rw-r--r-- | crates/ra_hir_def/src/lib.rs | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/crates/ra_hir_def/src/lib.rs b/crates/ra_hir_def/src/lib.rs index 1d195d65d..b063530c2 100644 --- a/crates/ra_hir_def/src/lib.rs +++ b/crates/ra_hir_def/src/lib.rs | |||
@@ -35,7 +35,7 @@ use std::hash::{Hash, Hasher}; | |||
35 | 35 | ||
36 | use hir_expand::{ast_id_map::FileAstId, db::AstDatabase, AstId, HirFileId, MacroDefId, Source}; | 36 | use hir_expand::{ast_id_map::FileAstId, db::AstDatabase, AstId, HirFileId, MacroDefId, Source}; |
37 | use ra_arena::{impl_arena_id, map::ArenaMap, RawId}; | 37 | use ra_arena::{impl_arena_id, map::ArenaMap, RawId}; |
38 | use ra_db::{salsa, CrateId}; | 38 | use ra_db::{impl_intern_key, salsa, CrateId}; |
39 | use ra_syntax::{ast, AstNode}; | 39 | use ra_syntax::{ast, AstNode}; |
40 | 40 | ||
41 | use crate::{builtin_type::BuiltinType, db::InternDatabase}; | 41 | use crate::{builtin_type::BuiltinType, db::InternDatabase}; |
@@ -56,19 +56,6 @@ pub struct ModuleId { | |||
56 | pub struct LocalModuleId(RawId); | 56 | pub struct LocalModuleId(RawId); |
57 | impl_arena_id!(LocalModuleId); | 57 | impl_arena_id!(LocalModuleId); |
58 | 58 | ||
59 | macro_rules! impl_intern_key { | ||
60 | ($name:ident) => { | ||
61 | impl salsa::InternKey for $name { | ||
62 | fn from_intern_id(v: salsa::InternId) -> Self { | ||
63 | $name(v) | ||
64 | } | ||
65 | fn as_intern_id(&self) -> salsa::InternId { | ||
66 | self.0 | ||
67 | } | ||
68 | } | ||
69 | }; | ||
70 | } | ||
71 | |||
72 | #[derive(Debug)] | 59 | #[derive(Debug)] |
73 | pub struct ItemLoc<N: AstNode> { | 60 | pub struct ItemLoc<N: AstNode> { |
74 | pub(crate) module: ModuleId, | 61 | pub(crate) module: ModuleId, |