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/infer/unify.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/infer/unify.rs')
-rw-r--r-- | crates/hir_ty/src/infer/unify.rs | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/crates/hir_ty/src/infer/unify.rs b/crates/hir_ty/src/infer/unify.rs index 5b7b423fa..1fc03c8f4 100644 --- a/crates/hir_ty/src/infer/unify.rs +++ b/crates/hir_ty/src/infer/unify.rs | |||
@@ -5,7 +5,7 @@ use std::borrow::Cow; | |||
5 | use chalk_ir::{FloatTy, IntTy, TyVariableKind}; | 5 | use chalk_ir::{FloatTy, IntTy, TyVariableKind}; |
6 | use ena::unify::{InPlaceUnificationTable, NoError, UnifyKey, UnifyValue}; | 6 | use ena::unify::{InPlaceUnificationTable, NoError, UnifyKey, UnifyValue}; |
7 | 7 | ||
8 | use super::{InferenceContext, Obligation}; | 8 | use super::{DomainGoal, InferenceContext}; |
9 | use crate::{ | 9 | use crate::{ |
10 | AliasEq, AliasTy, BoundVar, Canonical, DebruijnIndex, FnPointer, InEnvironment, InferenceVar, | 10 | AliasEq, AliasTy, BoundVar, Canonical, DebruijnIndex, FnPointer, InEnvironment, InferenceVar, |
11 | Interner, Scalar, Substitution, Ty, TyKind, TypeWalk, WhereClause, | 11 | Interner, Scalar, Substitution, Ty, TyKind, TypeWalk, WhereClause, |
@@ -87,14 +87,11 @@ impl<'a, 'b> Canonicalizer<'a, 'b> { | |||
87 | 87 | ||
88 | pub(crate) fn canonicalize_obligation( | 88 | pub(crate) fn canonicalize_obligation( |
89 | mut self, | 89 | mut self, |
90 | obligation: InEnvironment<Obligation>, | 90 | obligation: InEnvironment<DomainGoal>, |
91 | ) -> Canonicalized<InEnvironment<Obligation>> { | 91 | ) -> Canonicalized<InEnvironment<DomainGoal>> { |
92 | let result = match obligation.value { | 92 | let result = match obligation.value { |
93 | Obligation::Trait(tr) => { | 93 | DomainGoal::Holds(wc) => { |
94 | Obligation::Trait(self.do_canonicalize(tr, DebruijnIndex::INNERMOST)) | 94 | DomainGoal::Holds(self.do_canonicalize(wc, DebruijnIndex::INNERMOST)) |
95 | } | ||
96 | Obligation::AliasEq(alias_eq) => { | ||
97 | Obligation::AliasEq(self.do_canonicalize(alias_eq, DebruijnIndex::INNERMOST)) | ||
98 | } | 95 | } |
99 | }; | 96 | }; |
100 | self.into_canonicalized(InEnvironment { | 97 | self.into_canonicalized(InEnvironment { |