aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_def/src/lib.rs')
-rw-r--r--crates/ra_hir_def/src/lib.rs10
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 f63c3dd64..5bc9ffc0d 100644
--- a/crates/ra_hir_def/src/lib.rs
+++ b/crates/ra_hir_def/src/lib.rs
@@ -481,6 +481,16 @@ impl HasModule for ConstLoc {
481 } 481 }
482} 482}
483 483
484impl HasModule for AdtId {
485 fn module(&self, db: &impl db::DefDatabase) -> ModuleId {
486 match self {
487 AdtId::StructId(it) => it.0.module(db),
488 AdtId::UnionId(it) => it.0.module(db),
489 AdtId::EnumId(it) => it.module(db),
490 }
491 }
492}
493
484impl HasModule for StaticLoc { 494impl HasModule for StaticLoc {
485 fn module(&self, _db: &impl db::DefDatabase) -> ModuleId { 495 fn module(&self, _db: &impl db::DefDatabase) -> ModuleId {
486 self.container 496 self.container