From b9c0c2abb79769852119dc9a595e63ee74eeba03 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 20 Apr 2019 12:34:36 +0200 Subject: Chalk integration - add proper canonicalization logic - add conversions from/to Chalk IR --- crates/ra_hir/src/code_model_api.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'crates/ra_hir/src/code_model_api.rs') diff --git a/crates/ra_hir/src/code_model_api.rs b/crates/ra_hir/src/code_model_api.rs index 8f1ed1086..9dcae50a5 100644 --- a/crates/ra_hir/src/code_model_api.rs +++ b/crates/ra_hir/src/code_model_api.rs @@ -9,7 +9,7 @@ use crate::{ type_ref::TypeRef, nameres::{ModuleScope, Namespace, ImportId, CrateModuleId}, expr::{Body, BodySourceMap}, - ty::InferenceResult, + ty::{ TraitRef, InferenceResult}, adt::{EnumVariantId, StructFieldId, VariantDef}, generics::HasGenericParams, docs::{Documentation, Docs, docs_from_ast}, @@ -696,6 +696,10 @@ impl Trait { db.trait_data(self) } + pub fn trait_ref(self, db: &impl HirDatabase) -> TraitRef { + TraitRef::for_trait(db, self) + } + pub(crate) fn resolver(&self, db: &impl DefDatabase) -> Resolver { let r = self.module(db).resolver(db); // add generic params, if present -- cgit v1.2.3