mirror of
https://github.com/async-rs/async-std.git
synced 2025-04-08 17:36:43 +00:00
feat: Make the task module no_std
This commit is contained in:
parent
41f114d9fe
commit
6aa55fde59
3 changed files with 14 additions and 7 deletions
|
@ -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…
Reference in a new issue