diff options
Diffstat (limited to 'crates/ra_hir_def/src')
-rw-r--r-- | crates/ra_hir_def/src/lib.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/crates/ra_hir_def/src/lib.rs b/crates/ra_hir_def/src/lib.rs index 274dd1467..ea3f00bb3 100644 --- a/crates/ra_hir_def/src/lib.rs +++ b/crates/ra_hir_def/src/lib.rs | |||
@@ -398,6 +398,16 @@ impl_froms!( | |||
398 | ConstId | 398 | ConstId |
399 | ); | 399 | ); |
400 | 400 | ||
401 | impl From<AssocItemId> for GenericDefId { | ||
402 | fn from(item: AssocItemId) -> Self { | ||
403 | match item { | ||
404 | AssocItemId::FunctionId(f) => f.into(), | ||
405 | AssocItemId::ConstId(c) => c.into(), | ||
406 | AssocItemId::TypeAliasId(t) => t.into(), | ||
407 | } | ||
408 | } | ||
409 | } | ||
410 | |||
401 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] | 411 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] |
402 | pub enum AttrDefId { | 412 | pub enum AttrDefId { |
403 | ModuleId(ModuleId), | 413 | ModuleId(ModuleId), |