From 0fd770613bceb1e674c911485dc98a4eb272f981 Mon Sep 17 00:00:00 2001 From: David Barsky Date: Thu, 1 Feb 2024 16:06:05 -0500 Subject: [PATCH] internal: Move `TyBuilder::subst_for_def` into a block --- crates/hir-ty/src/method_resolution.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/hir-ty/src/method_resolution.rs b/crates/hir-ty/src/method_resolution.rs index 1c068bf684ae..21e603e497fc 100644 --- a/crates/hir-ty/src/method_resolution.rs +++ b/crates/hir-ty/src/method_resolution.rs @@ -1439,15 +1439,15 @@ fn is_valid_fn_candidate( _ => unreachable!(), }; - let fn_subst = TyBuilder::subst_for_def(db, fn_id, Some(impl_subst.clone())) - .fill_with_inference_vars(table) - .build(); - check_that!(table.unify(&expect_self_ty, self_ty)); if let Some(receiver_ty) = receiver_ty { check_that!(data.has_self_param()); + let fn_subst = TyBuilder::subst_for_def(db, fn_id, Some(impl_subst.clone())) + .fill_with_inference_vars(table) + .build(); + let sig = db.callable_item_signature(fn_id.into()); let expected_receiver = sig.map(|s| s.params()[0].clone()).substitute(Interner, &fn_subst);