-
Notifications
You must be signed in to change notification settings - Fork 471
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
Make std feature to depend on alloc feature #508
Conversation
There's an unused |
CI passed. |
Currently, crossbeam-epoch is empty crate if alloc feature disabled.
As a similar issue, adding no-std support to crossbeam-channel and crossbeam-deque, which currently do not have feature flags and depend on std, is actually a breaking change for crates using these crate with So, unless it's absolutely impossible for these crates to add support no-std, I tend to prefer to add |
|
Sounds good to me, let's do it. |
There is a discussion on this in rust-lang/api-guidelines#189, but as far as I know, it's the only way. Also, it may be nice to prevent users from accidental compilation without #[cfg(not(feature = "std"))]
compile_error!("`std` feature is currently required to build this crate");
For example regex is one of the 1.0+ crates that do this, but I'm not sure how many crates actually use this way. |
Ah, this approach doesn't work with crossbeam, as we depend on these crates via Line 24 in 24ab0fd
|
Also, I noticed that crossbeam-utils' alloc feature isn't really doing anything, so I removed it. |
Added document to feature flags (86a6aa6): # Enable to use APIs that require `std`.
# This is enabled by default.
std = ["alloc"]
# Enable to use APIs that require `alloc`.
# This is enabled by default and also enabled if the `std` feature is enabled.
alloc = []
# Enable to use of unstable functionality.
# This is disabled by default and requires recent nightly compiler.
# Note that this is outside of the normal semver guarantees and minor versions
# of crossbeam may make breaking changes to them at any time.
nightly = [] |
I'm happy with this PR. @stjepang do you have more to discuss? If not, I'll merge it 2 days later. Thanks! |
bors r+ |
alloc
crate is available on 1.36, see #368 (comment) for why it was previously separated.This is a breaking change proposed in #503.