Skip to content

Commit f096c8d

Browse files
author
Christian Poveda
committed
inferring expected types of closure arguments when coercing to a fn
1 parent 59f1a2f commit f096c8d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/librustc_typeck/check/closure.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
126126
(sig, kind)
127127
}
128128
ty::TyInfer(ty::TyVar(vid)) => self.deduce_expectations_from_obligations(vid),
129+
ty::TyFnPtr(sig) => (Some(sig.skip_binder().clone()), Some(ty::ClosureKind::Fn)),
129130
_ => (None, None),
130131
}
131132
}

0 commit comments

Comments
 (0)