Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add feature-flag based support option for no_std + alloc #49

Merged
merged 2 commits into from
Apr 23, 2018

Conversation

ZackPierce
Copy link
Contributor

This work is intended to allow bit-vec to operate in no_std environments which have access to alloc.

Existing users should not have any expected changes in use. New users interested in no_std mode (for embedded or wasm work) may opt-in by disabling a new default cargo flag, "std".

I expect to be making a similar PR to contain-rs/bit-set .

CC: @gankro @bholley

@ZackPierce
Copy link
Contributor Author

The Travis build appears to be failing due to an unrelated build error in cargo-crusader. I have submitted a probable fix over on that repo.

Substantively, the Travis builds presently show successful cargo test runs.

@ZackPierce
Copy link
Contributor Author

Re-attempted the travis build by closing and reopening the PR, with success!

@Gankra
Copy link
Contributor

Gankra commented Apr 23, 2018

CC @alexcrichton is this the expected way to support no_std?

@alexcrichton
Copy link
Contributor

I'd recommend unconditionally being flagged as #![no_std] and then whe it's enabled you explicitly extern crate std and import items from std

@ZackPierce
Copy link
Contributor Author

Thanks for the tip, @alexcrichton , I'll switch to that approach.

For the prior commit, I was hesitant to do an unconditional no_std on account of the reliance on alloc (for Vec), but I'm happy to oblige your recommendation. New commit coming later today.

@ZackPierce
Copy link
Contributor Author

@gankro Updated per Alex's suggestion.

@Gankra
Copy link
Contributor

Gankra commented Apr 23, 2018

LGTM, thanks!

@Gankra Gankra merged commit 0235d63 into contain-rs:master Apr 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants