Support for #![no_std]
#113
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds partial support for using piccolo from
#![no_std]platforms.This relies on a tiny patch to
gc-arenato make theallocator-api2feature work under#![no_std]; my patch for this is here: kyren/gc-arena@4d52634However,
piccolocurrently uses an old version ofgc-arena, so I'm not sure whether it would be better to update to the latest version before fixing that and merging this.I'd recommend reading through the diffs for each commit rather than the whole PR, because the import changes touch basically every file and make the diffs unreadable.
The major changes in this PR:
impl io::Readsrc/io.rs,src/stdlib/io.rs) under a newstdfeature, enabled by defaultmath.random, insrc/stdlib/math.rs) under a newrngfeature, enabled by defaultmathbehind thestdfeature, as Rust'scorelibrary doesn't provide them. We could work around this by adding an explicit dependency on alibmequivalent.std::process::abort()with a double panic inutil/src/freeze.rs-- please check to make sure I did that right! A double panic should always abort, but I don't know if it has the same guarantees asstd::process::abort().Here are the current limitations:
rngfeature, HashMap randomization will be mostly disabled, which can allow for denial of service attacksrngfeature should work on#![no_std], but will require the user to set upgetrandom's randomness source: https://docs.rs/getrandom/latest/getrandom/#custom-backendmathare missing inno_stdno_std