-
Notifications
You must be signed in to change notification settings - Fork 52
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
no_std + checking no_std builds in Travis CI #15
Conversation
This adds an enabled-by-default "std" cargo feature which can be selectively removed to enable no_std support. When the "std" feature is absent, feature(alloc) will be enabled to provide Vec support. This requires nightly, but since "std" is enabled by default, this should have no impact on stable users.
It would be great to see this in a new release! Very useful for generating minimal wasm binaries (with no_std). Thanks. |
FYI, this is a breaking change for any stable users who had I'm not impacted here -- just wanted to point it out because the same sort of thing bit me when I first tried to add |
Since the public API and functionality is not changing, it might be better to reverse the flag: have |
Though now that this is published, changing further risks breakage too. Now it's between my hypothetical stable |
Cargo features are intended to be additive, so I think keeping a "std" feature to add the dependency on The point about this being technically a breaking change is a good one: I hadn't thought of that. I think the best thing to do now is see if anyone was actually using |
Yes cargo feature flags should be additive, but depending on std is not a feature in itself. (In some crates depending on std might enable some of the crate’s own features, but this is not the case here.) I’d say that not depending on std is a feature, since it adds support for some targets. |
Anyway, with rust-lang/rfcs#2480 this crate can hopefully become |
True, as long as you don't lose anything in the process, like an impl for |
(Yes, this is what I meant.) |
Was going to rebase #10 to use
feature(alloc)
rather thanfeature(collections)
but it was already done. Added a check that no_std builds in Travis CI while I was at it.r? @SimonSapin