diff options
author | Florian Diebold <[email protected]> | 2021-03-20 10:23:59 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2021-03-20 11:47:12 +0000 |
commit | 7ec3b66f7a3ac0a33cf435bc3596fdac542fc52a (patch) | |
tree | 70a77a26ca09d8d5cd843b1cd9d59af229cd0daf /crates/hir_ty/src/traits/chalk | |
parent | 8e7e405f6ab0c1ee10bfdd3d55a97628fe4cd6dd (diff) |
Turn Obligation into something similar to chalk_ir::DomainGoal
This includes starting to make use of Chalk's `Cast` trait.
Diffstat (limited to 'crates/hir_ty/src/traits/chalk')
-rw-r--r-- | crates/hir_ty/src/traits/chalk/mapping.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/crates/hir_ty/src/traits/chalk/mapping.rs b/crates/hir_ty/src/traits/chalk/mapping.rs index 7841c216c..65feb82e5 100644 --- a/crates/hir_ty/src/traits/chalk/mapping.rs +++ b/crates/hir_ty/src/traits/chalk/mapping.rs | |||
@@ -13,7 +13,7 @@ use crate::{ | |||
13 | db::HirDatabase, | 13 | db::HirDatabase, |
14 | from_assoc_type_id, | 14 | from_assoc_type_id, |
15 | primitive::UintTy, | 15 | primitive::UintTy, |
16 | traits::{Canonical, Obligation}, | 16 | traits::{Canonical, DomainGoal}, |
17 | AliasTy, CallableDefId, FnPointer, InEnvironment, OpaqueTy, ProjectionTy, Scalar, Substitution, | 17 | AliasTy, CallableDefId, FnPointer, InEnvironment, OpaqueTy, ProjectionTy, Scalar, Substitution, |
18 | TraitRef, Ty, WhereClause, | 18 | TraitRef, Ty, WhereClause, |
19 | }; | 19 | }; |
@@ -422,13 +422,15 @@ impl ToChalk for AliasEq { | |||
422 | } | 422 | } |
423 | } | 423 | } |
424 | 424 | ||
425 | impl ToChalk for Obligation { | 425 | impl ToChalk for DomainGoal { |
426 | type Chalk = chalk_ir::DomainGoal<Interner>; | 426 | type Chalk = chalk_ir::DomainGoal<Interner>; |
427 | 427 | ||
428 | fn to_chalk(self, db: &dyn HirDatabase) -> chalk_ir::DomainGoal<Interner> { | 428 | fn to_chalk(self, db: &dyn HirDatabase) -> chalk_ir::DomainGoal<Interner> { |
429 | match self { | 429 | match self { |
430 | Obligation::Trait(tr) => tr.to_chalk(db).cast(&Interner), | 430 | DomainGoal::Holds(WhereClause::Implemented(tr)) => tr.to_chalk(db).cast(&Interner), |
431 | Obligation::AliasEq(alias_eq) => alias_eq.to_chalk(db).cast(&Interner), | 431 | DomainGoal::Holds(WhereClause::AliasEq(alias_eq)) => { |
432 | alias_eq.to_chalk(db).cast(&Interner) | ||
433 | } | ||
432 | } | 434 | } |
433 | } | 435 | } |
434 | 436 | ||