aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-06-29 12:01:36 +0100
committerbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-06-29 12:01:36 +0100
commit2bfcfb0b0e5e518e8fc2779c6564ed1009d3f920 (patch)
tree97b1732bc0bcfb1aee6ffa6496d5f70be264ef95 /crates/ra_hir/src
parent8865db6768fd913b971df56fc0bcf7439fcb1e71 (diff)
parentd37f960dfaac2272de3065ad586b25dc1cdb7dbd (diff)
Merge #1457
1457: Complete associated methods on enums (and unions) as well r=matklad a=flodiebold This has been seriously annoying me for a while ;) Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r--crates/ra_hir/src/code_model.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs
index ebbc37c0e..32f98e394 100644
--- a/crates/ra_hir/src/code_model.rs
+++ b/crates/ra_hir/src/code_model.rs
@@ -390,6 +390,10 @@ impl Union {
390 self.id.module(db) 390 self.id.module(db)
391 } 391 }
392 392
393 pub fn ty(self, db: &impl HirDatabase) -> Ty {
394 db.type_for_def(self.into(), Namespace::Types)
395 }
396
393 // FIXME move to a more general type 397 // FIXME move to a more general type
394 /// Builds a resolver for type references inside this union. 398 /// Builds a resolver for type references inside this union.
395 pub(crate) fn resolver(self, db: &impl HirDatabase) -> Resolver { 399 pub(crate) fn resolver(self, db: &impl HirDatabase) -> Resolver {