aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/builder.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_ty/src/builder.rs')
-rw-r--r--crates/hir_ty/src/builder.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/hir_ty/src/builder.rs b/crates/hir_ty/src/builder.rs
index 372621f73..9b2c6975a 100644
--- a/crates/hir_ty/src/builder.rs
+++ b/crates/hir_ty/src/builder.rs
@@ -139,7 +139,8 @@ impl TyBuilder<hir_def::AdtId> {
139 } else { 139 } else {
140 // each default can depend on the previous parameters 140 // each default can depend on the previous parameters
141 let subst_so_far = Substitution::intern(self.vec.clone()); 141 let subst_so_far = Substitution::intern(self.vec.clone());
142 self.vec.push(default_ty.clone().subst(&subst_so_far).cast(&Interner)); 142 self.vec
143 .push(default_ty.clone().substitute(&Interner, &subst_so_far).cast(&Interner));
143 } 144 }
144 } 145 }
145 self 146 self
@@ -194,13 +195,13 @@ impl TyBuilder<TypeAliasId> {
194 195
195impl<T: TypeWalk + HasInterner<Interner = Interner>> TyBuilder<Binders<T>> { 196impl<T: TypeWalk + HasInterner<Interner = Interner>> TyBuilder<Binders<T>> {
196 fn subst_binders(b: Binders<T>) -> Self { 197 fn subst_binders(b: Binders<T>) -> Self {
197 let param_count = b.num_binders; 198 let param_count = b.binders.len(&Interner);
198 TyBuilder::new(b, param_count) 199 TyBuilder::new(b, param_count)
199 } 200 }
200 201
201 pub fn build(self) -> T { 202 pub fn build(self) -> T {
202 let (b, subst) = self.build_internal(); 203 let (b, subst) = self.build_internal();
203 b.subst(&subst) 204 b.substitute(&Interner, &subst)
204 } 205 }
205} 206}
206 207