Dyn FnOnce without allocating

It cannot borrow func_cont for ’static because the variable certainly does not live that long, nor can it work on &mut self as described as problematic code would be accepted:

let mut func_cont = CallOnceContainer::new(func);
{
    let func_dyn = func_cont.to_dyn();
    foo_impl(func_dyn);
}  // any borrow by `.to_dyn()` ended at this point
{
    foo_impl(func_cont.to_dyn());  // we can borrow again
}
{
    foo_impl(func_cont.to_dyn());  // and a third time if we want
}