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 208bda7
Show file tree
Hide file tree
Showing 7 changed files with 2,053 additions and 2,012 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
9 changes: 9 additions & 0 deletions crossbeam-channel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,18 @@ description = "Multi-producer multi-consumer channels for message passing"
keywords = ["channel", "mpmc", "select", "golang", "message"]
categories = ["algorithms", "concurrency", "data-structures"]

[features]
default = ["std"]
std = ["crossbeam-utils/std"]

[dependencies]
cfg-if = "0.1.2"

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

[dev-dependencies]
num_cpus = "1.10.0"
Expand Down
56 changes: 32 additions & 24 deletions crossbeam-channel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,33 +346,41 @@
#![warn(missing_docs)]
#![warn(missing_debug_implementations)]
#![cfg_attr(not(feature = "std"), no_std)]

extern crate crossbeam_utils;
#[macro_use]
extern crate cfg_if;

mod channel;
mod context;
mod counter;
mod err;
mod flavors;
mod select;
mod select_macro;
mod utils;
mod waker;
cfg_if! {
if #[cfg(feature = "std")] {
extern crate crossbeam_utils;

/// Crate internals used by the `select!` macro.
#[doc(hidden)]
pub mod internal {
pub use select::SelectHandle;
pub use select::{select, select_timeout, try_select};
}
mod channel;
mod context;
mod counter;
mod err;
mod flavors;
mod select;
mod select_macro;
mod utils;
mod waker;

/// Crate internals used by the `select!` macro.
#[doc(hidden)]
pub mod internal {
pub use select::SelectHandle;
pub use select::{select, select_timeout, try_select};
}

pub use channel::{after, never, tick};
pub use channel::{bounded, unbounded};
pub use channel::{IntoIter, Iter, TryIter};
pub use channel::{Receiver, Sender};
pub use channel::{after, never, tick};
pub use channel::{bounded, unbounded};
pub use channel::{IntoIter, Iter, TryIter};
pub use channel::{Receiver, Sender};

pub use select::{Select, SelectedOperation};
pub use select::{Select, SelectedOperation};

pub use err::{ReadyTimeoutError, SelectTimeoutError, TryReadyError, TrySelectError};
pub use err::{RecvError, RecvTimeoutError, TryRecvError};
pub use err::{SendError, SendTimeoutError, TrySendError};
pub use err::{ReadyTimeoutError, SelectTimeoutError, TryReadyError, TrySelectError};
pub use err::{RecvError, RecvTimeoutError, TryRecvError};
pub use err::{SendError, SendTimeoutError, TrySendError};
}
}
11 changes: 11 additions & 0 deletions crossbeam-deque/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,24 @@ description = "Concurrent work-stealing deque"
keywords = ["chase-lev", "lock-free", "scheduler", "scheduling"]
categories = ["algorithms", "concurrency", "data-structures"]

[features]
default = ["std"]
std = ["crossbeam-epoch/std", "crossbeam-utils/std"]

[dependencies]
cfg-if = "0.1.2"

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

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

[dev-dependencies]
rand = "0.6"
Loading

0 comments on commit 208bda7

Please sign in to comment.