diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-03-20 11:47:50 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-03-20 11:47:50 +0000 |
commit | 4d67032bbb3e1f97ee7af43cb6f056d01f791ca2 (patch) | |
tree | 70a77a26ca09d8d5cd843b1cd9d59af229cd0daf /crates/hir_ty/src/traits/chalk/mapping.rs | |
parent | 5ac0290f533eed295c6e92564d7530d41cf45d6e (diff) | |
parent | 7ec3b66f7a3ac0a33cf435bc3596fdac542fc52a (diff) |
Merge #8117
8117: Turn Obligation into something similar to chalk_ir::DomainGoal r=flodiebold a=flodiebold
This includes starting to make use of Chalk's `Cast` trait.
Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/hir_ty/src/traits/chalk/mapping.rs')
-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 | ||