aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/infer/coerce.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-02-28 22:54:07 +0000
committerGitHub <[email protected]>2021-02-28 22:54:07 +0000
commit5df3ee8274fdb7cdeb2b0871b4efea8cbf4724a1 (patch)
treec1769a152888b97134e3f3811d4504f467ce1047 /crates/hir_ty/src/infer/coerce.rs
parent72457d022d704c47ab9dbfee6a1b29063cc9cc5d (diff)
parent407196b8c0f23e3ddc26e789b84542b1fd9b0eb8 (diff)
Merge #7816
7816: Lift Ty::Fn into a struct r=Veykril a=Veykril bors r+ Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/hir_ty/src/infer/coerce.rs')
-rw-r--r--crates/hir_ty/src/infer/coerce.rs4
1 files changed, 2 insertions, 2 deletions
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> {
89 | (Ty::Ref(Mutability::Shared, ..), Ty::Ref(Mutability::Mut, ..)) => return false, 89 | (Ty::Ref(Mutability::Shared, ..), Ty::Ref(Mutability::Mut, ..)) => return false,
90 90
91 // `{function_type}` -> `fn()` 91 // `{function_type}` -> `fn()`
92 (Ty::FnDef(..), Ty::FnPtr { .. }) => match from_ty.callable_sig(self.db) { 92 (Ty::FnDef(..), Ty::Function { .. }) => match from_ty.callable_sig(self.db) {
93 None => return false, 93 None => return false,
94 Some(sig) => { 94 Some(sig) => {
95 from_ty = Ty::fn_ptr(sig); 95 from_ty = Ty::fn_ptr(sig);
96 } 96 }
97 }, 97 },
98 98
99 (Ty::Closure { substs, .. }, Ty::FnPtr { .. }) => { 99 (Ty::Closure(.., substs), Ty::Function { .. }) => {
100 from_ty = substs[0].clone(); 100 from_ty = substs[0].clone();
101 } 101 }
102 102