aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-11-26 11:02:57 +0000
committerAleksey Kladov <[email protected]>2019-11-26 11:02:57 +0000
commite5eadb339039e21718d382c0b3d02a4bf053b3f4 (patch)
tree2f7839288ce5676a89c6d6062cbaf70544e0beed /crates/ra_hir_def/src
parent5901cc736074bbc4d780a8e45079d405ab2cec4b (diff)
Introduce hir::Type
It should provide a convenient API over more low-level Ty
Diffstat (limited to 'crates/ra_hir_def/src')
-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 a88a78b38..274dd1467 100644
--- a/crates/ra_hir_def/src/lib.rs
+++ b/crates/ra_hir_def/src/lib.rs
@@ -489,6 +489,16 @@ impl HasModule for AdtId {
489 } 489 }
490} 490}
491 491
492impl HasModule for DefWithBodyId {
493 fn module(&self, db: &impl db::DefDatabase) -> ModuleId {
494 match self {
495 DefWithBodyId::FunctionId(it) => it.lookup(db).module(db),
496 DefWithBodyId::StaticId(it) => it.lookup(db).module(db),
497 DefWithBodyId::ConstId(it) => it.lookup(db).module(db),
498 }
499 }
500}
501
492impl HasModule for StaticLoc { 502impl HasModule for StaticLoc {
493 fn module(&self, _db: &impl db::DefDatabase) -> ModuleId { 503 fn module(&self, _db: &impl db::DefDatabase) -> ModuleId {
494 self.container 504 self.container