feat: Make the task module no_std

pull/680/head
k-nasa 5 years ago
parent 41f114d9fe
commit 6aa55fde59

@ -39,7 +39,6 @@ unstable = ["std", "broadcaster", "futures-timer"]
attributes = ["async-attributes"]
std = [
"crossbeam-utils",
"futures-core",
"futures-io",
"memchr",
"once_cell",
@ -48,7 +47,9 @@ std = [
"slab",
"no-std",
]
no-std = []
no-std = [
"futures-core",
]
[dependencies]
async-attributes = { version = "1.1.1", optional = true }

@ -241,6 +241,10 @@ pub use async_attributes::{main, test};
#[cfg(feature = "std")]
mod macros;
cfg_no_std! {
pub mod task;
}
cfg_std! {
pub mod future;
pub mod io;
@ -248,7 +252,6 @@ cfg_std! {
pub mod prelude;
pub mod stream;
pub mod sync;
pub mod task;
}
cfg_default! {

@ -117,13 +117,16 @@
//! [`task_local!`]: ../macro.task_local.html
//! [`with`]: struct.LocalKey.html#method.with
cfg_std! {
cfg_no_std! {
#[doc(inline)]
pub use std::task::{Context, Poll, Waker};
pub use core::task::{Context, Poll, Waker};
pub use ready::ready;
pub use yield_now::yield_now;
mod ready;
}
cfg_std! {
pub use yield_now::yield_now;
mod yield_now;
}

Loading…
Cancel
Save