Returning impl Fn(T) -> impl Trait
does not compile, unless you add an identity
call
#107883
Labels
A-closures
Area: Closures (`|…| { … }`)
A-impl-trait
Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.
A-type-system
Area: Type system
C-bug
Category: This is a bug.
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
F-impl_trait_in_fn_trait_return
`#![feature(impl_trait_in_fn_trait_return)]`
T-types
Relevant to the types team, which will review and decide on the PR/issue.
I tried this code:
[play]
I expected to see this happen: all of the above functions successfully compile.
Instead, this happened:
f
andh
do not compile for no clear reason, whileg
,f_
andf__
do compile, even though they are all almost identical.Compiler output
Meta
Rustc version:
The text was updated successfully, but these errors were encountered: