diff options
author | Aleksey Kladov <[email protected]> | 2019-11-26 11:02:57 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-11-26 11:02:57 +0000 |
commit | e5eadb339039e21718d382c0b3d02a4bf053b3f4 (patch) | |
tree | 2f7839288ce5676a89c6d6062cbaf70544e0beed /crates/ra_hir_def | |
parent | 5901cc736074bbc4d780a8e45079d405ab2cec4b (diff) |
Introduce hir::Type
It should provide a convenient API over more low-level Ty
Diffstat (limited to 'crates/ra_hir_def')
-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 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 | ||
492 | impl 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 | |||
492 | impl HasModule for StaticLoc { | 502 | impl 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 |