I've made two small crates which are intended to expand the scope of GhostCell to allow for more generic solutions for singletons (e.g. a single global instance, one instance created in main). This was to fix an issue I had where I couldn't keep GhostCells in a data structure and still have it be
'static for use cases that didn't need to ever access the cell.
These are in the "somewhat messy but working/documented" stage. I'm hoping for some critiques of the idea, any safety problems, or how I can be more clear/rigorous on the invariants for the Singleton trait (I'd be unsurprised if this is underspecified on happens-before relationships), or the Erased struct which is inherently a tiny bit more complicated than one would hope?
Is it clear how it could be used with more general token types, besides the GhostCell clone provided by the