diff options
Diffstat (limited to 'crates/hir_ty/src/infer.rs')
-rw-r--r-- | crates/hir_ty/src/infer.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/crates/hir_ty/src/infer.rs b/crates/hir_ty/src/infer.rs index b871594bd..b208d821d 100644 --- a/crates/hir_ty/src/infer.rs +++ b/crates/hir_ty/src/infer.rs | |||
@@ -42,7 +42,7 @@ use super::{ | |||
42 | }; | 42 | }; |
43 | use crate::{ | 43 | use crate::{ |
44 | db::HirDatabase, infer::diagnostics::InferenceDiagnostic, lower::ImplTraitLoweringMode, | 44 | db::HirDatabase, infer::diagnostics::InferenceDiagnostic, lower::ImplTraitLoweringMode, |
45 | to_assoc_type_id, to_chalk_trait_id, AliasEq, AliasTy, Interner, TyKind, | 45 | to_assoc_type_id, AliasEq, AliasTy, Interner, TyBuilder, TyKind, |
46 | }; | 46 | }; |
47 | 47 | ||
48 | // This lint has a false positive here. See the link below for details. | 48 | // This lint has a false positive here. See the link below for details. |
@@ -409,16 +409,14 @@ impl<'a> InferenceContext<'a> { | |||
409 | _ => panic!("resolve_associated_type called with non-associated type"), | 409 | _ => panic!("resolve_associated_type called with non-associated type"), |
410 | }; | 410 | }; |
411 | let ty = self.table.new_type_var(); | 411 | let ty = self.table.new_type_var(); |
412 | let substs = Substitution::build_for_def(self.db, res_assoc_ty) | 412 | let trait_ref = TyBuilder::trait_ref(self.db, trait_) |
413 | .push(inner_ty) | 413 | .push(inner_ty) |
414 | .fill(params.iter().cloned()) | 414 | .fill(params.iter().cloned()) |
415 | .build(); | 415 | .build(); |
416 | let trait_ref = | ||
417 | TraitRef { trait_id: to_chalk_trait_id(trait_), substitution: substs.clone() }; | ||
418 | let alias_eq = AliasEq { | 416 | let alias_eq = AliasEq { |
419 | alias: AliasTy::Projection(ProjectionTy { | 417 | alias: AliasTy::Projection(ProjectionTy { |
420 | associated_ty_id: to_assoc_type_id(res_assoc_ty), | 418 | associated_ty_id: to_assoc_type_id(res_assoc_ty), |
421 | substitution: substs, | 419 | substitution: trait_ref.substitution.clone(), |
422 | }), | 420 | }), |
423 | ty: ty.clone(), | 421 | ty: ty.clone(), |
424 | }; | 422 | }; |