Skip to content

Commit 8e074e2

Browse files
committed
Add missing assertions to auto_traits test
1 parent d9a09e7 commit 8e074e2

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

futures/tests/auto_traits.rs

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,6 +1383,26 @@ pub mod stream {
13831383
assert_impl!(Next<'_, ()>: Unpin);
13841384
assert_not_impl!(Next<'_, PhantomPinned>: Unpin);
13851385

1386+
assert_impl!(NextIf<'_, SendStream<()>, ()>: Send);
1387+
assert_not_impl!(NextIf<'_, SendStream<()>, *const ()>: Send);
1388+
assert_not_impl!(NextIf<'_, SendStream, ()>: Send);
1389+
assert_not_impl!(NextIf<'_, LocalStream<()>, ()>: Send);
1390+
assert_impl!(NextIf<'_, SyncStream<()>, ()>: Sync);
1391+
assert_not_impl!(NextIf<'_, SyncStream<()>, *const ()>: Sync);
1392+
assert_not_impl!(NextIf<'_, SyncStream, ()>: Sync);
1393+
assert_not_impl!(NextIf<'_, LocalStream<()>, ()>: Send);
1394+
assert_impl!(NextIf<'_, PinnedStream, PhantomPinned>: Unpin);
1395+
1396+
assert_impl!(NextIfEq<'_, SendStream<()>, ()>: Send);
1397+
assert_not_impl!(NextIfEq<'_, SendStream<()>, *const ()>: Send);
1398+
assert_not_impl!(NextIfEq<'_, SendStream, ()>: Send);
1399+
assert_not_impl!(NextIfEq<'_, LocalStream<()>, ()>: Send);
1400+
assert_impl!(NextIfEq<'_, SyncStream<()>, ()>: Sync);
1401+
assert_not_impl!(NextIfEq<'_, SyncStream<()>, *const ()>: Sync);
1402+
assert_not_impl!(NextIfEq<'_, SyncStream, ()>: Sync);
1403+
assert_not_impl!(NextIfEq<'_, LocalStream<()>, ()>: Send);
1404+
assert_impl!(NextIfEq<'_, PinnedStream, PhantomPinned>: Unpin);
1405+
13861406
assert_impl!(Once<()>: Send);
13871407
assert_not_impl!(Once<*const ()>: Send);
13881408
assert_impl!(Once<()>: Sync);
@@ -1781,23 +1801,31 @@ pub mod stream {
17811801
assert_not_impl!(Zip<PinnedStream, UnpinStream>: Unpin);
17821802

17831803
assert_impl!(futures_unordered::Iter<()>: Send);
1804+
assert_not_impl!(futures_unordered::Iter<*const ()>: Send);
17841805
assert_impl!(futures_unordered::Iter<()>: Sync);
1806+
assert_not_impl!(futures_unordered::Iter<*const ()>: Sync);
17851807
assert_impl!(futures_unordered::Iter<()>: Unpin);
1786-
// futures_unordered::Iter requires `Fut: Unpin`
1808+
// The definition of futures_unordered::Iter has `Fut: Unpin` bounds.
17871809
// assert_not_impl!(futures_unordered::Iter<PhantomPinned>: Unpin);
17881810

17891811
assert_impl!(futures_unordered::IterMut<()>: Send);
1812+
assert_not_impl!(futures_unordered::IterMut<*const ()>: Send);
17901813
assert_impl!(futures_unordered::IterMut<()>: Sync);
1814+
assert_not_impl!(futures_unordered::IterMut<*const ()>: Sync);
17911815
assert_impl!(futures_unordered::IterMut<()>: Unpin);
1792-
// futures_unordered::IterMut requires `Fut: Unpin`
1816+
// The definition of futures_unordered::IterMut has `Fut: Unpin` bounds.
17931817
// assert_not_impl!(futures_unordered::IterMut<PhantomPinned>: Unpin);
17941818

17951819
assert_impl!(futures_unordered::IterPinMut<()>: Send);
1820+
assert_not_impl!(futures_unordered::IterPinMut<*const ()>: Send);
17961821
assert_impl!(futures_unordered::IterPinMut<()>: Sync);
1822+
assert_not_impl!(futures_unordered::IterPinMut<*const ()>: Sync);
17971823
assert_impl!(futures_unordered::IterPinMut<PhantomPinned>: Unpin);
17981824

17991825
assert_impl!(futures_unordered::IterPinRef<()>: Send);
1826+
assert_not_impl!(futures_unordered::IterPinRef<*const ()>: Send);
18001827
assert_impl!(futures_unordered::IterPinRef<()>: Sync);
1828+
assert_not_impl!(futures_unordered::IterPinRef<*const ()>: Sync);
18011829
assert_impl!(futures_unordered::IterPinRef<PhantomPinned>: Unpin);
18021830
}
18031831

0 commit comments

Comments
 (0)