Skip to content

Commit 653d272

Browse files
arcnmxcramertj
authored andcommitted
Allow async-await macros to be used without std
`select!()` is the only macro that requires std due to implementation details, so allow everything else through.
1 parent a9f81d6 commit 653d272

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

futures-util/src/async_await/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ mod select_mod;
3131
#[cfg(feature = "async-await-macro")]
3232
pub use self::select_mod::*;
3333

34+
#[cfg(feature = "std")]
3435
#[cfg(feature = "async-await-macro")]
3536
mod random;
37+
#[cfg(feature = "std")]
3638
#[cfg(feature = "async-await-macro")]
3739
pub use self::random::*;
3840

futures-util/src/async_await/select_mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ macro_rules! document_select_macro {
306306
}
307307

308308
document_select_macro! {
309+
#[cfg(feature = "std")]
309310
#[proc_macro_hack(support_nested)]
310311
pub use futures_macro::select;
311312

futures-util/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,10 @@ pub use futures_core::ready;
3939
pub use pin_utils::pin_mut;
4040

4141
// Not public API.
42-
#[cfg(feature = "std")]
4342
#[cfg(feature = "async-await")]
4443
#[macro_use]
4544
#[doc(hidden)]
4645
pub mod async_await;
47-
#[cfg(feature = "std")]
4846
#[cfg(feature = "async-await")]
4947
#[doc(hidden)]
5048
pub use self::async_await::*;

futures/src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -542,23 +542,21 @@ pub mod never {
542542
pub use futures_core::core_reexport;
543543

544544
// Not public API.
545-
#[cfg(feature = "std")]
546545
#[cfg(feature = "async-await")]
547546
#[doc(hidden)]
548547
pub use futures_util::async_await;
549548

550549
// Not public API.
551-
#[cfg(feature = "std")]
552550
#[cfg(feature = "async-await")]
553551
#[doc(hidden)]
554552
pub mod inner_macro {
555553
pub use futures_util::join;
556554
pub use futures_util::try_join;
555+
#[cfg(feature = "std")]
557556
pub use futures_util::select;
558557
pub use futures_util::select_biased;
559558
}
560559

561-
#[cfg(feature = "std")]
562560
#[cfg(feature = "async-await")]
563561
futures_util::document_join_macro! {
564562
#[macro_export]
@@ -582,9 +580,9 @@ futures_util::document_join_macro! {
582580
}
583581
}
584582

585-
#[cfg(feature = "std")]
586583
#[cfg(feature = "async-await")]
587584
futures_util::document_select_macro! {
585+
#[cfg(feature = "std")]
588586
#[macro_export]
589587
macro_rules! select { // replace `::futures_util` with `::futures` as the crate path
590588
($($tokens:tt)*) => {

0 commit comments

Comments
 (0)