Do you mean the closure type of
let f = |a|{}
f(&f);
would be
struct Closure< /*CK =*/ Fn, /*CS =*/ fn(Closure<Fn, fn(Closure<Fn,...,U>, U>), U >(...U);
where CS = fn(Closure<Fn, CS, U>)
such that the type name is infinite.
Do you mean the closure type of
let f = |a|{}
f(&f);
would be
struct Closure< /*CK =*/ Fn, /*CS =*/ fn(Closure<Fn, fn(Closure<Fn,...,U>, U>), U >(...U);
where CS = fn(Closure<Fn, CS, U>)
such that the type name is infinite.
It appears that's the case during inference at least, which -- as is probably clear from everything else I've said in this thread -- is news to me. And pre-NLL or so it didn't use to be.
These nerd-snipes can be so informative .
Random thought: if you allow closures with signatures that can't be expressed with a function pointer type, you have to check more than "no captures" to see if a cast to a function pointer is sound. (Apparently that was happening to some extent.)