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"] attributes = ["async-attributes"]
std = [ std = [
"crossbeam-utils", "crossbeam-utils",
"futures-core",
"futures-io", "futures-io",
"memchr", "memchr",
"once_cell", "once_cell",
@ -48,7 +47,9 @@ std = [
"slab", "slab",
"no-std", "no-std",
] ]
no-std = [] no-std = [
"futures-core",
]
[dependencies] [dependencies]
async-attributes = { version = "1.1.1", optional = true } async-attributes = { version = "1.1.1", optional = true }

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

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

Loading…
Cancel
Save