diff options
author | Lukas Wirth <[email protected]> | 2021-03-19 01:07:15 +0000 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2021-03-19 11:12:18 +0000 |
commit | 8996b1a2353539cb9c264d0effbde80567de6586 (patch) | |
tree | 4702a4384ee97782670c20e597c40e7da61b4fc2 /crates/hir | |
parent | 86878443b1789cac0e48177f5f2b95ad0d6e912c (diff) |
Replace Projection variant in GenericPredicate with AliasEq
Diffstat (limited to 'crates/hir')
-rw-r--r-- | crates/hir/src/lib.rs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index 67ec8e82a..5ebd0a3b8 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs | |||
@@ -56,9 +56,9 @@ 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 | AliasTy, BoundVar, CallableDefId, CallableSig, Canonical, DebruijnIndex, GenericPredicate, | 59 | AliasEq, AliasTy, BoundVar, CallableDefId, CallableSig, Canonical, DebruijnIndex, |
60 | InEnvironment, Interner, Obligation, ProjectionPredicate, ProjectionTy, Scalar, Substitution, | 60 | GenericPredicate, InEnvironment, Interner, Obligation, ProjectionTy, Scalar, Substitution, Ty, |
61 | Ty, TyDefId, TyKind, TyVariableKind, | 61 | TyDefId, TyKind, TyVariableKind, |
62 | }; | 62 | }; |
63 | use itertools::Itertools; | 63 | use itertools::Itertools; |
64 | use rustc_hash::FxHashSet; | 64 | use rustc_hash::FxHashSet; |
@@ -1786,17 +1786,17 @@ impl Type { | |||
1786 | .push(self.ty.value.clone()) | 1786 | .push(self.ty.value.clone()) |
1787 | .fill(args.iter().map(|t| t.ty.value.clone())) | 1787 | .fill(args.iter().map(|t| t.ty.value.clone())) |
1788 | .build(); | 1788 | .build(); |
1789 | let predicate = ProjectionPredicate { | ||
1790 | projection_ty: ProjectionTy { | ||
1791 | associated_ty_id: to_assoc_type_id(alias.id), | ||
1792 | substitution: subst, | ||
1793 | }, | ||
1794 | ty: TyKind::BoundVar(BoundVar::new(DebruijnIndex::INNERMOST, 0)).intern(&Interner), | ||
1795 | }; | ||
1796 | let goal = Canonical { | 1789 | let goal = Canonical { |
1797 | value: InEnvironment::new( | 1790 | value: InEnvironment::new( |
1798 | self.ty.environment.clone(), | 1791 | self.ty.environment.clone(), |
1799 | Obligation::Projection(predicate), | 1792 | Obligation::AliasEq(AliasEq { |
1793 | alias: AliasTy::Projection(ProjectionTy { | ||
1794 | associated_ty_id: to_assoc_type_id(alias.id), | ||
1795 | substitution: subst, | ||
1796 | }), | ||
1797 | ty: TyKind::BoundVar(BoundVar::new(DebruijnIndex::INNERMOST, 0)) | ||
1798 | .intern(&Interner), | ||
1799 | }), | ||
1800 | ), | 1800 | ), |
1801 | kinds: Arc::new([TyVariableKind::General]), | 1801 | kinds: Arc::new([TyVariableKind::General]), |
1802 | }; | 1802 | }; |