From d37f960dfaac2272de3065ad586b25dc1cdb7dbd Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 29 Jun 2019 12:40:01 +0200 Subject: Complete associated methods on enums (and unions) as well --- crates/ra_hir/src/code_model.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'crates/ra_hir/src') 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 { self.id.module(db) } + pub fn ty(self, db: &impl HirDatabase) -> Ty { + db.type_for_def(self.into(), Namespace::Types) + } + // FIXME move to a more general type /// Builds a resolver for type references inside this union. pub(crate) fn resolver(self, db: &impl HirDatabase) -> Resolver { -- cgit v1.2.3