diff --git a/futures-util/src/stream/futures_unordered/mod.rs b/futures-util/src/stream/futures_unordered/mod.rs index 6b5804dc4..0dbaea908 100644 --- a/futures-util/src/stream/futures_unordered/mod.rs +++ b/futures-util/src/stream/futures_unordered/mod.rs @@ -62,7 +62,7 @@ pub struct FuturesUnordered { } unsafe impl Send for FuturesUnordered {} -unsafe impl Sync for FuturesUnordered {} +unsafe impl Sync for FuturesUnordered {} impl Unpin for FuturesUnordered {} impl Spawn for FuturesUnordered> { diff --git a/futures/tests/auto_traits.rs b/futures/tests/auto_traits.rs index 5fc0f7d67..004fda1e7 100644 --- a/futures/tests/auto_traits.rs +++ b/futures/tests/auto_traits.rs @@ -18,6 +18,8 @@ pub type SendFuture = Pin + Send>>; pub type SendTryFuture = SendFuture>; pub type SyncFuture = Pin + Sync>>; pub type SyncTryFuture = SyncFuture>; +pub type SendSyncFuture = Pin + Send + Sync>>; +pub type SendSyncTryFuture = SendSyncFuture>; pub type UnpinFuture = LocalFuture; pub type UnpinTryFuture = UnpinFuture>; pub struct PinnedFuture(PhantomPinned, PhantomData); @@ -35,6 +37,8 @@ pub type SendStream = Pin + Send>>; pub type SendTryStream = SendStream>; pub type SyncStream = Pin + Sync>>; pub type SyncTryStream = SyncStream>; +pub type SendSyncStream = Pin + Send + Sync>>; +pub type SendSyncTryStream = SendSyncStream>; pub type UnpinStream = LocalStream; pub type UnpinTryStream = UnpinStream>; pub struct PinnedStream(PhantomPinned, PhantomData); @@ -365,9 +369,10 @@ pub mod future { assert_impl!(JoinAll>: Send); assert_not_impl!(JoinAll: Send); assert_not_impl!(JoinAll: Send); - assert_impl!(JoinAll>: Sync); - assert_not_impl!(JoinAll: Sync); - assert_not_impl!(JoinAll: Sync); + assert_impl!(JoinAll>: Sync); + assert_not_impl!(JoinAll>: Sync); + assert_not_impl!(JoinAll>: Sync); + assert_not_impl!(JoinAll: Sync); assert_impl!(JoinAll: Unpin); assert_impl!(Lazy<()>: Send); @@ -579,9 +584,10 @@ pub mod future { assert_impl!(TryJoinAll>: Send); assert_not_impl!(TryJoinAll: Send); assert_not_impl!(TryJoinAll: Send); - assert_impl!(TryJoinAll>: Sync); - assert_not_impl!(TryJoinAll: Sync); - assert_not_impl!(TryJoinAll: Sync); + assert_impl!(TryJoinAll>: Sync); + assert_not_impl!(TryJoinAll>: Sync); + assert_not_impl!(TryJoinAll>: Sync); + assert_not_impl!(TryJoinAll: Sync); assert_impl!(TryJoinAll: Unpin); assert_impl!(TrySelect: Send); @@ -1118,10 +1124,9 @@ pub mod stream { assert_not_impl!(Buffered>: Send); assert_not_impl!(Buffered>: Send); assert_not_impl!(Buffered>>: Send); - assert_impl!(Buffered>>: Sync); - assert_not_impl!(Buffered>: Sync); - assert_not_impl!(Buffered>: Sync); - assert_not_impl!(Buffered>>: Sync); + assert_impl!(Buffered>>: Sync); + assert_not_impl!(Buffered>>: Sync); + assert_not_impl!(Buffered>>: Sync); assert_impl!(Buffered>: Unpin); assert_not_impl!(Buffered>: Unpin); @@ -1303,9 +1308,10 @@ pub mod stream { assert_impl!(FuturesOrdered>: Send); assert_not_impl!(FuturesOrdered: Send); assert_not_impl!(FuturesOrdered: Send); - assert_impl!(FuturesOrdered>: Sync); - assert_not_impl!(FuturesOrdered>: Sync); - assert_not_impl!(FuturesOrdered>: Sync); + assert_impl!(FuturesOrdered>: Sync); + assert_not_impl!(FuturesOrdered>: Sync); + assert_not_impl!(FuturesOrdered>: Sync); + assert_not_impl!(FuturesOrdered: Sync); assert_impl!(FuturesOrdered: Unpin); assert_impl!(FuturesUnordered<()>: Send); @@ -1647,11 +1653,12 @@ pub mod stream { assert_not_impl!(TryBuffered>>: Send); assert_not_impl!(TryBuffered>>: Send); assert_not_impl!(TryBuffered>>: Send); - assert_impl!(TryBuffered>>: Sync); - assert_not_impl!(TryBuffered>>: Sync); - assert_not_impl!(TryBuffered>>: Sync); - assert_not_impl!(TryBuffered>>: Sync); - assert_not_impl!(TryBuffered>>: Sync); + assert_impl!(TryBuffered>>: Sync); + assert_not_impl!(TryBuffered>>: Sync); + assert_not_impl!(TryBuffered>>: Sync); + assert_not_impl!(TryBuffered>>: Sync); + assert_not_impl!(TryBuffered>>: Sync); + assert_not_impl!(TryBuffered>>: Sync); assert_impl!(TryBuffered>: Unpin); assert_not_impl!(TryBuffered>: Unpin);