aboutsummaryrefslogtreecommitdiff
path: root/crates/hir/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-03-20 11:47:50 +0000
committerGitHub <[email protected]>2021-03-20 11:47:50 +0000
commit4d67032bbb3e1f97ee7af43cb6f056d01f791ca2 (patch)
tree70a77a26ca09d8d5cd843b1cd9d59af229cd0daf /crates/hir/src
parent5ac0290f533eed295c6e92564d7530d41cf45d6e (diff)
parent7ec3b66f7a3ac0a33cf435bc3596fdac542fc52a (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/src')
-rw-r--r--crates/hir/src/lib.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs
index 268a2b901..30e577671 100644
--- a/crates/hir/src/lib.rs
+++ b/crates/hir/src/lib.rs
@@ -56,8 +56,8 @@ use hir_ty::{
56 primitive::UintTy, 56 primitive::UintTy,
57 to_assoc_type_id, 57 to_assoc_type_id,
58 traits::{FnTrait, Solution, SolutionVariables}, 58 traits::{FnTrait, Solution, SolutionVariables},
59 AliasEq, AliasTy, BoundVar, CallableDefId, CallableSig, Canonical, DebruijnIndex, 59 AliasEq, AliasTy, BoundVar, CallableDefId, CallableSig, Canonical, Cast, DebruijnIndex,
60 InEnvironment, Interner, Obligation, ProjectionTy, Scalar, Substitution, Ty, TyDefId, TyKind, 60 InEnvironment, Interner, ProjectionTy, Scalar, Substitution, Ty, TyDefId, TyKind,
61 TyVariableKind, WhereClause, 61 TyVariableKind, WhereClause,
62}; 62};
63use itertools::Itertools; 63use itertools::Itertools;
@@ -1767,7 +1767,7 @@ impl Type {
1767 let goal = Canonical { 1767 let goal = Canonical {
1768 value: hir_ty::InEnvironment::new( 1768 value: hir_ty::InEnvironment::new(
1769 self.ty.environment.clone(), 1769 self.ty.environment.clone(),
1770 hir_ty::Obligation::Trait(trait_ref), 1770 trait_ref.cast(&Interner),
1771 ), 1771 ),
1772 kinds: Arc::new([]), 1772 kinds: Arc::new([]),
1773 }; 1773 };
@@ -1789,14 +1789,15 @@ impl Type {
1789 let goal = Canonical { 1789 let goal = Canonical {
1790 value: InEnvironment::new( 1790 value: InEnvironment::new(
1791 self.ty.environment.clone(), 1791 self.ty.environment.clone(),
1792 Obligation::AliasEq(AliasEq { 1792 AliasEq {
1793 alias: AliasTy::Projection(ProjectionTy { 1793 alias: AliasTy::Projection(ProjectionTy {
1794 associated_ty_id: to_assoc_type_id(alias.id), 1794 associated_ty_id: to_assoc_type_id(alias.id),
1795 substitution: subst, 1795 substitution: subst,
1796 }), 1796 }),
1797 ty: TyKind::BoundVar(BoundVar::new(DebruijnIndex::INNERMOST, 0)) 1797 ty: TyKind::BoundVar(BoundVar::new(DebruijnIndex::INNERMOST, 0))
1798 .intern(&Interner), 1798 .intern(&Interner),
1799 }), 1799 }
1800 .cast(&Interner),
1800 ), 1801 ),
1801 kinds: Arc::new([TyVariableKind::General]), 1802 kinds: Arc::new([TyVariableKind::General]),
1802 }; 1803 };