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 | |
parent | f11237561c391eecba39c5ba57defa2dc7a27b21 (diff) |
Pull macro up
Diffstat (limited to 'crates/ra_hir')
-rw-r--r-- | crates/ra_hir/src/ids.rs | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/crates/ra_hir/src/ids.rs b/crates/ra_hir/src/ids.rs index 145837f7f..67de8b243 100644 --- a/crates/ra_hir/src/ids.rs +++ b/crates/ra_hir/src/ids.rs | |||
@@ -5,20 +5,7 @@ | |||
5 | //! This module defines a bunch of ids we are using. The most important ones are | 5 | //! This module defines a bunch of ids we are using. The most important ones are |
6 | //! probably `HirFileId` and `DefId`. | 6 | //! probably `HirFileId` and `DefId`. |
7 | 7 | ||
8 | use ra_db::salsa; | 8 | use ra_db::{impl_intern_key, salsa}; |
9 | |||
10 | macro_rules! impl_intern_key { | ||
11 | ($name:ident) => { | ||
12 | impl salsa::InternKey for $name { | ||
13 | fn from_intern_id(v: salsa::InternId) -> Self { | ||
14 | $name(v) | ||
15 | } | ||
16 | fn as_intern_id(&self) -> salsa::InternId { | ||
17 | self.0 | ||
18 | } | ||
19 | } | ||
20 | }; | ||
21 | } | ||
22 | 9 | ||
23 | /// This exists just for Chalk, because Chalk just has a single `StructId` where | 10 | /// This exists just for Chalk, because Chalk just has a single `StructId` where |
24 | /// we have different kinds of ADTs, primitive types and special type | 11 | /// we have different kinds of ADTs, primitive types and special type |