aboutsummaryrefslogtreecommitdiff
path: root/crates/hir/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-03-19 11:12:54 +0000
committerGitHub <[email protected]>2021-03-19 11:12:54 +0000
commit98d29d4f538899a8bd8caac7f4d2459438a1ae9a (patch)
tree49fc49a406fed5f239a5a8a7cee4cf52fb56e568 /crates/hir/src
parent26fdd17cc6fc79b476977c2a40a90de7095e4b45 (diff)
parent8996b1a2353539cb9c264d0effbde80567de6586 (diff)
Merge #8101
8101: Replace Projection variant in GenericPredicate with AliasEq r=flodiebold a=Veykril Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/hir/src')
-rw-r--r--crates/hir/src/lib.rs22
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};
63use itertools::Itertools; 63use itertools::Itertools;
64use rustc_hash::FxHashSet; 64use 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 };