From 407196b8c0f23e3ddc26e789b84542b1fd9b0eb8 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Sun, 28 Feb 2021 22:12:07 +0100 Subject: Lift FnPointer into a struct --- crates/hir_ty/src/infer/coerce.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/hir_ty/src/infer/coerce.rs') diff --git a/crates/hir_ty/src/infer/coerce.rs b/crates/hir_ty/src/infer/coerce.rs index cd5fb3252..4cca35904 100644 --- a/crates/hir_ty/src/infer/coerce.rs +++ b/crates/hir_ty/src/infer/coerce.rs @@ -89,14 +89,14 @@ impl<'a> InferenceContext<'a> { | (Ty::Ref(Mutability::Shared, ..), Ty::Ref(Mutability::Mut, ..)) => return false, // `{function_type}` -> `fn()` - (Ty::FnDef(..), Ty::FnPtr { .. }) => match from_ty.callable_sig(self.db) { + (Ty::FnDef(..), Ty::Function { .. }) => match from_ty.callable_sig(self.db) { None => return false, Some(sig) => { from_ty = Ty::fn_ptr(sig); } }, - (Ty::Closure { substs, .. }, Ty::FnPtr { .. }) => { + (Ty::Closure(.., substs), Ty::Function { .. }) => { from_ty = substs[0].clone(); } -- cgit v1.2.3