Wait why is that never being stabilized it’s a very very very useful feature ;_;
(though in the collections/allocator case, could libstd not instead expose it like pub type HashMap<T> = collections::HashMap<T, StdAllocator>;? not quite ideal, though…)
This is an experiment I partially wrote the mock bind backend for. You’d get compiler errors if you tried using any unimplemented features, but they’d otherwise be removed by the link/optimize step so you would get a partial libstd that worked as long as you didn’t call into IO or whatever else. It can of course be implemented in pure rust instead, or have methods modified to unconditionally return Err()s or panic at runtime, etc.
I’d like to at some point see libstd functionality become more modular, where it may be possible to build on a platform without threads, or without networking, but still take advantage of the majority of the greater crates.io ecosystem. These proposed changes would be a good start to making it possible and start experimenting with the techniques described above, though it certainly doesn’t provide a robust final solution.