To share your playground, click Share in the upper-right and then copy the Permalink. (Your current link just goes to the base page, which loads up whatever was in the editor last time for each individual visitor.)
In general, you put unsized things in a Box. For trait objects in particular, that's generally spelled Box<dyn Trait>, or as needed, Box<dyn Trait + Send + Sync> or the like. For Futures on top of that, you typically want a Pin<Box<dyn Future + Send>>.
let inner: Box<dyn Fn(_) -> _> = Box::new(|task| {
let fut: DoSomething = Box::pin(do_something(task));
fut
});
Wow! This is such a nice way to get -> impl Future "pin-boxed".
I do get that we need to Box unsized things, but never knew that we could simply specify the type F as Box<dyn Fn(Task) -> DoSomething> where F is bounded by Fn(T) -> Fut. It is strange to me: