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.rs20
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;
17use std::hash::Hash; 17use std::hash::Hash;
18use std::sync::Arc; 18use std::sync::Arc;
19 19
20use ra_db::{salsa, CrateId, FileId}; 20use ra_db::{impl_intern_key, salsa, CrateId, FileId};
21use ra_syntax::{ 21use 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)]
176pub struct LazyMacroId(salsa::InternId); 176pub struct LazyMacroId(salsa::InternId);
177impl salsa::InternKey for LazyMacroId { 177impl_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)]
187pub struct EagerMacroId(salsa::InternId); 180pub struct EagerMacroId(salsa::InternId);
188impl salsa::InternKey for EagerMacroId { 181impl_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
197impl From<LazyMacroId> for MacroCallId { 183impl From<LazyMacroId> for MacroCallId {
198 fn from(it: LazyMacroId) -> Self { 184 fn from(it: LazyMacroId) -> Self {