aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty/traits
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/ty/traits')
-rw-r--r--crates/ra_hir/src/ty/traits/chalk.rs17
1 files changed, 16 insertions, 1 deletions
diff --git a/crates/ra_hir/src/ty/traits/chalk.rs b/crates/ra_hir/src/ty/traits/chalk.rs
index 32a45731d..2df4dd13f 100644
--- a/crates/ra_hir/src/ty/traits/chalk.rs
+++ b/crates/ra_hir/src/ty/traits/chalk.rs
@@ -12,7 +12,7 @@ use chalk_rust_ir::{AssociatedTyDatum, ImplDatum, StructDatum, TraitDatum};
12use ra_db::salsa::{InternId, InternKey}; 12use ra_db::salsa::{InternId, InternKey};
13use test_utils::tested_by; 13use test_utils::tested_by;
14 14
15use super::{Canonical, ChalkContext}; 15use super::{Canonical, ChalkContext, Obligation};
16use crate::{ 16use crate::{
17 db::HirDatabase, 17 db::HirDatabase,
18 generics::GenericDef, 18 generics::GenericDef,
@@ -233,6 +233,21 @@ impl ToChalk for super::ProjectionPredicate {
233 } 233 }
234} 234}
235 235
236impl ToChalk for Obligation {
237 type Chalk = chalk_ir::DomainGoal;
238
239 fn to_chalk(self, db: &impl HirDatabase) -> chalk_ir::DomainGoal {
240 match self {
241 Obligation::Trait(tr) => tr.to_chalk(db).cast(),
242 Obligation::Projection(pr) => pr.to_chalk(db).cast(),
243 }
244 }
245
246 fn from_chalk(_db: &impl HirDatabase, _goal: chalk_ir::DomainGoal) -> Self {
247 unimplemented!()
248 }
249}
250
236impl<T> ToChalk for Canonical<T> 251impl<T> ToChalk for Canonical<T>
237where 252where
238 T: ToChalk, 253 T: ToChalk,