|
9 | 9 |
|
10 | 10 | #[cfg(all(test, feature = "std"))] |
11 | 11 | use crate::sync::{Arc, Mutex}; |
12 | | -use crate::util::async_poll::{MaybeSend, MaybeSync}; |
13 | 12 |
|
| 13 | +#[cfg(test)] |
| 14 | +use alloc::boxed::Box; |
14 | 15 | #[cfg(all(test, not(feature = "std")))] |
15 | 16 | use alloc::rc::Rc; |
16 | 17 |
|
@@ -53,6 +54,34 @@ trait MaybeSendableFuture: Future<Output = ()> + MaybeSend + 'static {} |
53 | 54 | #[cfg(test)] |
54 | 55 | impl<F: Future<Output = ()> + MaybeSend + 'static> MaybeSendableFuture for F {} |
55 | 56 |
|
| 57 | +/// Marker trait to optionally implement `Sync` under std. |
| 58 | +/// |
| 59 | +/// This is not exported to bindings users as async is only supported in Rust. |
| 60 | +#[cfg(feature = "std")] |
| 61 | +pub use core::marker::Sync as MaybeSync; |
| 62 | + |
| 63 | +#[cfg(not(feature = "std"))] |
| 64 | +/// Marker trait to optionally implement `Sync` under std. |
| 65 | +/// |
| 66 | +/// This is not exported to bindings users as async is only supported in Rust. |
| 67 | +pub trait MaybeSync {} |
| 68 | +#[cfg(not(feature = "std"))] |
| 69 | +impl<T> MaybeSync for T where T: ?Sized {} |
| 70 | + |
| 71 | +/// Marker trait to optionally implement `Send` under std. |
| 72 | +/// |
| 73 | +/// This is not exported to bindings users as async is only supported in Rust. |
| 74 | +#[cfg(feature = "std")] |
| 75 | +pub use core::marker::Send as MaybeSend; |
| 76 | + |
| 77 | +#[cfg(not(feature = "std"))] |
| 78 | +/// Marker trait to optionally implement `Send` under std. |
| 79 | +/// |
| 80 | +/// This is not exported to bindings users as async is only supported in Rust. |
| 81 | +pub trait MaybeSend {} |
| 82 | +#[cfg(not(feature = "std"))] |
| 83 | +impl<T> MaybeSend for T where T: ?Sized {} |
| 84 | + |
56 | 85 | /// A simple [`FutureSpawner`] which holds [`Future`]s until they are manually polled via |
57 | 86 | /// [`Self::poll_futures`]. |
58 | 87 | #[cfg(all(test, feature = "std"))] |
|
0 commit comments