diff options
Diffstat (limited to 'crates/ra_hir/src/ty/traits')
-rw-r--r-- | crates/ra_hir/src/ty/traits/chalk.rs | 17 |
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}; | |||
12 | use ra_db::salsa::{InternId, InternKey}; | 12 | use ra_db::salsa::{InternId, InternKey}; |
13 | use test_utils::tested_by; | 13 | use test_utils::tested_by; |
14 | 14 | ||
15 | use super::{Canonical, ChalkContext}; | 15 | use super::{Canonical, ChalkContext, Obligation}; |
16 | use crate::{ | 16 | use 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 | ||
236 | impl 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 | |||
236 | impl<T> ToChalk for Canonical<T> | 251 | impl<T> ToChalk for Canonical<T> |
237 | where | 252 | where |
238 | T: ToChalk, | 253 | T: ToChalk, |