Suggestion: Implement Default for function items

Thanks for the link. Somehow I didn't encounter this issue on search engines.

Imagine if I want to store a collection of different decorated functions which have the same signature. It's not possible to use impl Fn(SomeType) in that way directly except for statically dispatching it.

That sounds interesting. I thought to somehow use traits too but I didn't want to burden the consumer of my library to implement a trait for every freestanding function they give.

It seems that they'll have to create a dummy type so that they could do impl Trait for Dummy. I wonder if there is a way around that boilerplate?

Box<dyn Fn()> alone will fit my needs, considering the fact that function item types are ZST so I don't think any actual allocation will happen. I'm mostly trying to avoid the additional size and indirection of dyn Fn(), which may be costly as this is likely going to be one of the hottest loop in my code.