impl trait from unboxed_closure does not accept closures #58708
Labels
A-impl-trait
Area: impl Trait. Universally / existentially quantified anonymous types with static dispatch.
C-bug
Category: This is a bug.
It's impossible to pass closure to a generic fn with impl trait argument when the trait comes from unboxed_closure feature.
This compiles (uses impl Fn with arrow):
But this fails (uses impl trait from unboxed_closure):
Returns error:
Precise definition of closure's types does not help.
Playground
The text was updated successfully, but these errors were encountered: