diff options
| author | Michael Goulet <michael@errs.io> | 2023-10-05 00:05:04 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-10-05 00:05:45 +0000 |
| commit | dfbb1bfc892d442cd9456f52ebc99a95c7dfbdcd (patch) | |
| tree | d98526b906d09fb6c689eb66bf4fd427a6a4be45 /compiler | |
| parent | 966f27977a888b332ff007f615c45e509e70576e (diff) | |
| download | rust-dfbb1bfc892d442cd9456f52ebc99a95c7dfbdcd.tar.gz rust-dfbb1bfc892d442cd9456f52ebc99a95c7dfbdcd.zip | |
Also closures
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_hir_typeck/src/closure.rs | 4 |
1 files changed, 3 insertions, 1 deletions
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); |
