From dfbb1bfc892d442cd9456f52ebc99a95c7dfbdcd Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Thu, 5 Oct 2023 00:05:04 +0000 Subject: Also closures --- compiler/rustc_hir_typeck/src/closure.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'compiler') diff --git a/compiler/rustc_hir_typeck/src/closure.rs b/compiler/rustc_hir_typeck/src/closure.rs index d4d62a40328..e506c150f7d 100644 --- a/compiler/rustc_hir_typeck/src/closure.rs +++ b/compiler/rustc_hir_typeck/src/closure.rs @@ -56,7 +56,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { // closure sooner rather than later, so first examine the expected // type, and see if can glean a closure kind from there. let (expected_sig, expected_kind) = match expected.to_option(self) { - Some(ty) => self.deduce_closure_signature(ty), + Some(ty) => { + self.deduce_closure_signature(self.try_structurally_resolve_type(expr_span, ty)) + } None => (None, None), }; let body = self.tcx.hir().body(closure.body); -- cgit 1.4.1-3-g733a5