Add `nightly` feature flag for `Alloc` -> `AllocRef` changes
Technically there was another breaking change in AllocRef later, so idk if calling the feature nightly is best or if using rustc-version cfg would be better, but if anyone else finds this useful, this works for our rustup default nightly-2020-03-10 based-builds.
Changelog
Enhancement
- Add
nightlyfeature for nightly-2020-03-10 compatibility. Changes uses ofAlloctoAllocRefwith accompanying function signatures.
I unfortunately don't have a ton of time to follow the changes upstream, so given the instability of the API my preference would likely be to remove the nightly support rather than trying to keep up with it I think?
We’re using nightly for WASM support and we’re also using dlmallloc for WASM support. Would that mean we would lose WASM support?
Do you mean the Rust standard library or something external? This feature doesn't affect Rust's usage of dlmalloc for the wasm target, nor external wasm users using the dlmalloc crate for a global allocator. This is specifically for a nightly feature which you have to opt-in to with unstable APIs, which rarely happens I believe right now.
Hmm... Ok, my development notes are probably just wrong then.
We are likely using the allocator-api because dlmalloc is supplying the low-level "sys_alloc" that we build the GC allocator on top of in Lumen (Erlang in the browser and other AOT targets)
As I am the only contributer from the allocator wg, I could update this crate as well if this is really needed. There is a major overhaul of AllocRef in the queue, so before putting to much effort into this, the linked PR should have landed.
There isn't a great need for this for Rust's libstd, but I"m not familiar with @KronicDeth's Lumen use case, which may need it.