From 05eba0db3dd76f016aabdd49af6211e70a1812ed Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Mon, 5 Apr 2021 18:39:53 +0200 Subject: Binders::subst -> substitute --- crates/hir_ty/src/infer/pat.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/hir_ty/src/infer/pat.rs') diff --git a/crates/hir_ty/src/infer/pat.rs b/crates/hir_ty/src/infer/pat.rs index 469f37dd9..b74f1f4f8 100644 --- a/crates/hir_ty/src/infer/pat.rs +++ b/crates/hir_ty/src/infer/pat.rs @@ -49,7 +49,7 @@ impl<'a> InferenceContext<'a> { let expected_ty = var_data .as_ref() .and_then(|d| d.field(&Name::new_tuple_field(i))) - .map_or(self.err_ty(), |field| field_tys[field].clone().subst(&substs)); + .map_or(self.err_ty(), |field| field_tys[field].clone().substitute(&substs)); let expected_ty = self.normalize_associated_types_in(expected_ty); self.infer_pat(subpat, &expected_ty, default_bm); } @@ -84,7 +84,7 @@ impl<'a> InferenceContext<'a> { } let expected_ty = matching_field - .map_or(self.err_ty(), |field| field_tys[field].clone().subst(&substs)); + .map_or(self.err_ty(), |field| field_tys[field].clone().substitute(&substs)); let expected_ty = self.normalize_associated_types_in(expected_ty); self.infer_pat(subpat.pat, &expected_ty, default_bm); } -- cgit v1.2.3 From 30a339e038bfd94d8c91f79287be9b7db4f0cb4e Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Mon, 5 Apr 2021 18:49:26 +0200 Subject: Add Interner parameter to Binders::substitute --- crates/hir_ty/src/infer/pat.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'crates/hir_ty/src/infer/pat.rs') diff --git a/crates/hir_ty/src/infer/pat.rs b/crates/hir_ty/src/infer/pat.rs index b74f1f4f8..252ae914a 100644 --- a/crates/hir_ty/src/infer/pat.rs +++ b/crates/hir_ty/src/infer/pat.rs @@ -49,7 +49,9 @@ impl<'a> InferenceContext<'a> { let expected_ty = var_data .as_ref() .and_then(|d| d.field(&Name::new_tuple_field(i))) - .map_or(self.err_ty(), |field| field_tys[field].clone().substitute(&substs)); + .map_or(self.err_ty(), |field| { + field_tys[field].clone().substitute(&Interner, &substs) + }); let expected_ty = self.normalize_associated_types_in(expected_ty); self.infer_pat(subpat, &expected_ty, default_bm); } @@ -83,8 +85,9 @@ impl<'a> InferenceContext<'a> { self.result.record_pat_field_resolutions.insert(subpat.pat, field_def); } - let expected_ty = matching_field - .map_or(self.err_ty(), |field| field_tys[field].clone().substitute(&substs)); + let expected_ty = matching_field.map_or(self.err_ty(), |field| { + field_tys[field].clone().substitute(&Interner, &substs) + }); let expected_ty = self.normalize_associated_types_in(expected_ty); self.infer_pat(subpat.pat, &expected_ty, default_bm); } -- cgit v1.2.3