diff options
Diffstat (limited to 'crates/ra_hir_expand/src/lib.rs')
-rw-r--r-- | crates/ra_hir_expand/src/lib.rs | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/crates/ra_hir_expand/src/lib.rs b/crates/ra_hir_expand/src/lib.rs index 3fce73e8a..7b72eb7a0 100644 --- a/crates/ra_hir_expand/src/lib.rs +++ b/crates/ra_hir_expand/src/lib.rs | |||
@@ -17,7 +17,7 @@ pub mod eager; | |||
17 | use std::hash::Hash; | 17 | use std::hash::Hash; |
18 | use std::sync::Arc; | 18 | use std::sync::Arc; |
19 | 19 | ||
20 | use ra_db::{salsa, CrateId, FileId}; | 20 | use ra_db::{impl_intern_key, salsa, CrateId, FileId}; |
21 | use ra_syntax::{ | 21 | use ra_syntax::{ |
22 | algo, | 22 | algo, |
23 | ast::{self, AstNode}, | 23 | ast::{self, AstNode}, |
@@ -174,25 +174,11 @@ pub enum MacroCallId { | |||
174 | 174 | ||
175 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | 175 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] |
176 | pub struct LazyMacroId(salsa::InternId); | 176 | pub struct LazyMacroId(salsa::InternId); |
177 | impl salsa::InternKey for LazyMacroId { | 177 | impl_intern_key!(LazyMacroId); |
178 | fn from_intern_id(v: salsa::InternId) -> Self { | ||
179 | LazyMacroId(v) | ||
180 | } | ||
181 | fn as_intern_id(&self) -> salsa::InternId { | ||
182 | self.0 | ||
183 | } | ||
184 | } | ||
185 | 178 | ||
186 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | 179 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] |
187 | pub struct EagerMacroId(salsa::InternId); | 180 | pub struct EagerMacroId(salsa::InternId); |
188 | impl salsa::InternKey for EagerMacroId { | 181 | impl_intern_key!(EagerMacroId); |
189 | fn from_intern_id(v: salsa::InternId) -> Self { | ||
190 | EagerMacroId(v) | ||
191 | } | ||
192 | fn as_intern_id(&self) -> salsa::InternId { | ||
193 | self.0 | ||
194 | } | ||
195 | } | ||
196 | 182 | ||
197 | impl From<LazyMacroId> for MacroCallId { | 183 | impl From<LazyMacroId> for MacroCallId { |
198 | fn from(it: LazyMacroId) -> Self { | 184 | fn from(it: LazyMacroId) -> Self { |