Generic Fn wrapper breaks without type annotations #37464
Labels
A-closures
Area: closures (`|args| { .. }`)
A-inference
Area: Type inference
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I have a generic
FnWrapper
struct for closures that take a&i32
as their only parameter, and a genericapply
function that consumes such wrappers (not directly, but viaFoo
trait).Run in playground.
When invoking
apply
without any annotations, compiler complains about:Simply adding type annotation to the closure parameter will make this compile, so it looks like a bug to me.
The text was updated successfully, but these errors were encountered: