Skip to content

Commit

Permalink
Add std feature to all crates for forward compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed May 20, 2020
1 parent 5214981 commit bf15c19
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ default = ["std"]
nightly = ["crossbeam-epoch/nightly", "crossbeam-utils/nightly", "crossbeam-queue/nightly"]
std = [
"alloc",
"crossbeam-channel",
"crossbeam-deque",
"crossbeam-channel/std",
"crossbeam-deque/std",
"crossbeam-epoch/std",
"crossbeam-queue/std",
"crossbeam-utils/std",
Expand All @@ -38,11 +38,13 @@ cfg-if = "0.1.2"
[dependencies.crossbeam-channel]
version = "0.4"
path = "./crossbeam-channel"
default-features = false
optional = true

[dependencies.crossbeam-deque]
version = "0.7.0"
path = "./crossbeam-deque"
default-features = false
optional = true

[dependencies.crossbeam-epoch]
Expand Down
4 changes: 4 additions & 0 deletions crossbeam-channel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ description = "Multi-producer multi-consumer channels for message passing"
keywords = ["channel", "mpmc", "select", "golang", "message"]
categories = ["algorithms", "concurrency", "data-structures"]

[features]
default = ["std"]
std = []

[dependencies.crossbeam-utils]
version = "0.7"
path = "../crossbeam-utils"
Expand Down
3 changes: 3 additions & 0 deletions crossbeam-channel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,9 @@
#![warn(missing_docs)]
#![warn(missing_debug_implementations)]

#[cfg(not(feature = "std"))]
compile_error!("`std` feature is currently required to build this crate");

extern crate crossbeam_utils;

mod channel;
Expand Down
4 changes: 4 additions & 0 deletions crossbeam-deque/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ description = "Concurrent work-stealing deque"
keywords = ["chase-lev", "lock-free", "scheduler", "scheduling"]
categories = ["algorithms", "concurrency", "data-structures"]

[features]
default = ["std"]
std = []

[dependencies.crossbeam-epoch]
version = "0.8"
path = "../crossbeam-epoch"
Expand Down
3 changes: 3 additions & 0 deletions crossbeam-deque/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@
#![warn(missing_docs)]
#![warn(missing_debug_implementations)]

#[cfg(not(feature = "std"))]
compile_error!("`std` feature is currently required to build this crate");

extern crate crossbeam_epoch as epoch;
extern crate crossbeam_utils as utils;

Expand Down
3 changes: 3 additions & 0 deletions crossbeam-epoch/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@
#![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(feature = "nightly", feature(cfg_target_has_atomic))]

#[cfg(feature = "alloc")]
compile_error!("`std` or `alloc` feature is currently required to build this crate");

#[macro_use]
extern crate cfg_if;
#[cfg(feature = "alloc")]
Expand Down

0 comments on commit bf15c19

Please sign in to comment.