rework #![no_std] support, switch on alloc
#236
Merged
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.
Finally got around to change I brought up in #220. See also #233.
Most of the uses of
std
in the crate are ofVec
,String
, andBox
, which are inalloc
, which is available on#![no_std]
viaextern crate alloc;
. This commit adjusts these uses to usealloc
directly and adds analloc
feature flag to control them. The notable exceptions still requiring astd
flag areHashMap
andHashSet
(I'm working on a separate change to addBTree{Map,Set}
support for#![no_std]
envs).frunk_core
no longer needs astd
flag: it has been marked deprecated with a comment.The reimport of
core
asstd
(see #220 for historical explanation) is converted to direct usage ofcore
everywhere.Removed
#[cfg(feature = "std")]
condition fromfrunk_laws
and made it depend onfrunk/std
-- it depends onquickcheck
, which requiresstd
.Added
#[cfg(test)] extern crate std;
to#![no_std]
crates, asstd
is required to run the libtest harness.Tested against all the combinations of feature flags I could think of. Successfully compiles into a
#![no_std]
embedded project withalloc
enabled.