mirror of
https://github.com/async-rs/async-std.git
synced 2025-01-16 10:49:55 +00:00
fix: Change feature name no-std to alloc
This commit is contained in:
parent
22d929d481
commit
7efe7caf66
6 changed files with 10 additions and 10 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
@ -58,7 +58,7 @@ jobs:
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
command: check
|
command: check
|
||||||
args: --no-default-features --features no-std
|
args: --no-default-features --features alloc
|
||||||
|
|
||||||
- name: check attributes
|
- name: check attributes
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
|
|
|
@ -44,9 +44,9 @@ std = [
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"pin-utils",
|
"pin-utils",
|
||||||
"slab",
|
"slab",
|
||||||
"no-std",
|
"alloc",
|
||||||
]
|
]
|
||||||
no-std = [
|
alloc = [
|
||||||
"futures-core",
|
"futures-core",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
]
|
]
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
//! [`Future::race`]: trait.Future.html#method.race
|
//! [`Future::race`]: trait.Future.html#method.race
|
||||||
//! [`Future::try_race`]: trait.Future.html#method.try_race
|
//! [`Future::try_race`]: trait.Future.html#method.try_race
|
||||||
|
|
||||||
cfg_no_std! {
|
cfg_alloc! {
|
||||||
pub use future::Future;
|
pub use future::Future;
|
||||||
pub(crate) mod future;
|
pub(crate) mod future;
|
||||||
}
|
}
|
||||||
|
|
|
@ -241,7 +241,7 @@ pub use async_attributes::{main, test};
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
mod macros;
|
mod macros;
|
||||||
|
|
||||||
cfg_no_std! {
|
cfg_alloc! {
|
||||||
pub mod task;
|
pub mod task;
|
||||||
pub mod future;
|
pub mod future;
|
||||||
pub mod stream;
|
pub mod stream;
|
||||||
|
|
|
@ -117,7 +117,7 @@
|
||||||
//! [`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_no_std! {
|
cfg_alloc! {
|
||||||
#[doc(inline)]
|
#[doc(inline)]
|
||||||
pub use core::task::{Context, Poll, Waker};
|
pub use core::task::{Context, Poll, Waker};
|
||||||
pub use ready::ready;
|
pub use ready::ready;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#[cfg(feature = "no-std")]
|
#[cfg(feature = "alloc")]
|
||||||
extern crate alloc;
|
extern crate alloc;
|
||||||
|
|
||||||
#[cfg(feature = "no-std")]
|
#[cfg(feature = "alloc")]
|
||||||
use alloc::string::String;
|
use alloc::string::String;
|
||||||
|
|
||||||
/// Calls a function and aborts if it panics.
|
/// Calls a function and aborts if it panics.
|
||||||
|
@ -173,10 +173,10 @@ macro_rules! cfg_std {
|
||||||
/// Declares no-std items.
|
/// Declares no-std items.
|
||||||
#[allow(unused_macros)]
|
#[allow(unused_macros)]
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
macro_rules! cfg_no_std {
|
macro_rules! cfg_alloc {
|
||||||
($($item:item)*) => {
|
($($item:item)*) => {
|
||||||
$(
|
$(
|
||||||
#[cfg(feature = "no-std")]
|
#[cfg(feature = "alloc")]
|
||||||
$item
|
$item
|
||||||
)*
|
)*
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue