3 ms·
I mean, rust does have the equivalent of #ifdef. There are platform-specific things. It's just that, with the benefit of hindsight, we designed support in thre
by steveklabnik 6y ago
I mean, rust does have the equivalent of #ifdef. There are platform-specific things.
It's just that, with the benefit of hindsight, we designed support in three major layers:
* core, which only relies on there being like, a symbol for memcpy
* alloc, which gives you a heap
* std, which gives you operating system-dependent features
Based on this hierarchy, a lot of libraries that are OS dependent may use only core, or core + alloc. And way more crates do this than you might think, and it's pretty easy to move a crate to them if they truly don't need all that libstd has to offer.