diff options
author | Aleksey Kladov <[email protected]> | 2019-11-15 16:14:50 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-11-15 18:19:32 +0000 |
commit | 080dd31f8460cba0298405fbcfcab8b61a4667ff (patch) | |
tree | e49b92c0d61d0728c7bf1c712ecb6f0e24813439 /crates/ra_hir_def/src/lib.rs | |
parent | aeb5e061a8912b3b80bef3d1e8155c6c2f32855a (diff) |
Add ImplId
Diffstat (limited to 'crates/ra_hir_def/src/lib.rs')
-rw-r--r-- | crates/ra_hir_def/src/lib.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/crates/ra_hir_def/src/lib.rs b/crates/ra_hir_def/src/lib.rs index 3fab7965c..22650db8b 100644 --- a/crates/ra_hir_def/src/lib.rs +++ b/crates/ra_hir_def/src/lib.rs | |||
@@ -321,6 +321,18 @@ impl AstItemDef<ast::TypeAliasDef> for TypeAliasId { | |||
321 | } | 321 | } |
322 | } | 322 | } |
323 | 323 | ||
324 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | ||
325 | pub struct ImplId(salsa::InternId); | ||
326 | impl_intern_key!(ImplId); | ||
327 | impl AstItemDef<ast::ImplBlock> for ImplId { | ||
328 | fn intern(db: &impl InternDatabase, loc: ItemLoc<ast::ImplBlock>) -> Self { | ||
329 | db.intern_impl(loc) | ||
330 | } | ||
331 | fn lookup_intern(self, db: &impl InternDatabase) -> ItemLoc<ast::ImplBlock> { | ||
332 | db.lookup_intern_impl(self) | ||
333 | } | ||
334 | } | ||
335 | |||
324 | macro_rules! impl_froms { | 336 | macro_rules! impl_froms { |
325 | ($e:ident: $($v:ident $(($($sv:ident),*))?),*) => { | 337 | ($e:ident: $($v:ident $(($($sv:ident),*))?),*) => { |
326 | $( | 338 | $( |