pub fn with_static<T: 'static, F: FnOnce(&'static mut T)>(t: T, f: F) -> !Expand description
Stores t in stack memory and provides a &'static mut T to a function
which will never return.
Since F: FnOnce(...) -> !, the stack memory holding t will never be
reclaimed, and so it can live forever (ie, be referenced using &'static mut T).
If f unwinds, with_static will loop {} forever to prevent t from
being reclaimed.