Here's one in particular:
In principal, this would allow us to statically allocate
a buffer sized for each particular closure.
Unfortunately, there is no size_of keyword in Rust,
and static initialization cannot invoke functions—
in this case the function size_of<T>() -> usize provided
by the Rust core library.
This can be solved by using the lazy_static crate:https://github.com/rust-lang-nursery/lazy-static.rs
From the description in the README:
Using this macro, it is possible to have statics that
require code to be executed at runtime in order to be
initialized.
Hey look, it's exactly what they need! It's also "no_std" compatible and can work just fine in a kernel-like context.Take this paper with a grain of salt: it's a bit dated at this point, and there are solutions for a number of the problems posed.