From 7efe7caf66012ae6eb92e667f372f7a6ad6bd282 Mon Sep 17 00:00:00 2001 From: k-nasa Date: Tue, 28 Jan 2020 15:58:06 +0900 Subject: [PATCH] fix: Change feature name no-std to alloc --- .github/workflows/ci.yml | 2 +- Cargo.toml | 4 ++-- src/future/mod.rs | 2 +- src/lib.rs | 2 +- src/task/mod.rs | 2 +- src/utils.rs | 8 ++++---- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b0e84f..597c2b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,7 +58,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: check - args: --no-default-features --features no-std + args: --no-default-features --features alloc - name: check attributes uses: actions-rs/cargo@v1 diff --git a/Cargo.toml b/Cargo.toml index 1206129..da6187a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,9 +44,9 @@ std = [ "once_cell", "pin-utils", "slab", - "no-std", + "alloc", ] -no-std = [ +alloc = [ "futures-core", "pin-project-lite", ] diff --git a/src/future/mod.rs b/src/future/mod.rs index 3d325be..9b75533 100644 --- a/src/future/mod.rs +++ b/src/future/mod.rs @@ -46,7 +46,7 @@ //! [`Future::race`]: trait.Future.html#method.race //! [`Future::try_race`]: trait.Future.html#method.try_race -cfg_no_std! { +cfg_alloc! { pub use future::Future; pub(crate) mod future; } diff --git a/src/lib.rs b/src/lib.rs index f35d6cb..b5a3fff 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -241,7 +241,7 @@ pub use async_attributes::{main, test}; #[cfg(feature = "std")] mod macros; -cfg_no_std! { +cfg_alloc! { pub mod task; pub mod future; pub mod stream; diff --git a/src/task/mod.rs b/src/task/mod.rs index 680e2a5..13fe903 100644 --- a/src/task/mod.rs +++ b/src/task/mod.rs @@ -117,7 +117,7 @@ //! [`task_local!`]: ../macro.task_local.html //! [`with`]: struct.LocalKey.html#method.with -cfg_no_std! { +cfg_alloc! { #[doc(inline)] pub use core::task::{Context, Poll, Waker}; pub use ready::ready; diff --git a/src/utils.rs b/src/utils.rs index ccf5e84..e257d2f 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -1,7 +1,7 @@ -#[cfg(feature = "no-std")] +#[cfg(feature = "alloc")] extern crate alloc; -#[cfg(feature = "no-std")] +#[cfg(feature = "alloc")] use alloc::string::String; /// Calls a function and aborts if it panics. @@ -173,10 +173,10 @@ macro_rules! cfg_std { /// Declares no-std items. #[allow(unused_macros)] #[doc(hidden)] -macro_rules! cfg_no_std { +macro_rules! cfg_alloc { ($($item:item)*) => { $( - #[cfg(feature = "no-std")] + #[cfg(feature = "alloc")] $item )* }