This could still work, if Shared::new(...) were a compile-time function. Or a language-extension that looked like a compile-time function.
EDIT: You wouldn't be allowed to have Shared::new inside of a loop or a recursive function though. But as long as you had assurances that any such Shared::new instance ran exactly once throughout the code, it might work?
Or maybe that's too ugly. "static" probably captures the idea better
I'm not sure if this is kosher in the world of Rust, but...
This could still work, if Shared::new(...) were a compile-time function. Or a language-extension that looked like a compile-time function.EDIT: You wouldn't be allowed to have Shared::new inside of a loop or a recursive function though. But as long as you had assurances that any such Shared::new instance ran exactly once throughout the code, it might work?
Or maybe that's too ugly. "static" probably captures the idea better