Skip to content

Commit 38dc14f

Browse files
committed
Assert Send/Sync/Unpin for all public types in task module
1 parent 0a50913 commit 38dc14f

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

futures/tests/auto_traits.rs

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,6 +1081,26 @@ pub mod stream {
10811081

10821082
/// Assert Send/Sync/Unpin for all public types in `futures::task`.
10831083
pub mod task {
1084-
// use super::*;
1085-
// use futures::task::*;
1084+
use super::*;
1085+
use futures::task::*;
1086+
1087+
assert_impl!(AtomicWaker: Send);
1088+
assert_impl!(AtomicWaker: Sync);
1089+
assert_impl!(AtomicWaker: Unpin);
1090+
1091+
assert_impl!(FutureObj<*const ()>: Send);
1092+
assert_impl!(FutureObj<PhantomPinned>: Unpin);
1093+
assert_not_impl!(FutureObj<()>: Sync);
1094+
1095+
assert_impl!(LocalFutureObj<PhantomPinned>: Unpin);
1096+
assert_not_impl!(LocalFutureObj<()>: Send);
1097+
assert_not_impl!(LocalFutureObj<()>: Sync);
1098+
1099+
assert_impl!(SpawnError: Send);
1100+
assert_impl!(SpawnError: Sync);
1101+
assert_impl!(SpawnError: Unpin);
1102+
1103+
assert_impl!(WakerRef<'_>: Send);
1104+
assert_impl!(WakerRef<'_>: Sync);
1105+
assert_impl!(WakerRef<'_>: Unpin);
10861106
}

0 commit comments

Comments
 (0)