Skip to content

Commit

Permalink
Add missing tests for Send/Sync/Unpin in mpsc
Browse files Browse the repository at this point in the history
  • Loading branch information
tbu- committed Aug 18, 2024
1 parent 0c4d295 commit 28119cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 6 additions & 0 deletions tokio/tests/async_send_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,12 @@ assert_value!(tokio::sync::mpsc::UnboundedReceiver<YY>: Send & Sync & Unpin);
assert_value!(tokio::sync::mpsc::UnboundedSender<NN>: !Send & !Sync & Unpin);
assert_value!(tokio::sync::mpsc::UnboundedSender<YN>: Send & Sync & Unpin);
assert_value!(tokio::sync::mpsc::UnboundedSender<YY>: Send & Sync & Unpin);
assert_value!(tokio::sync::mpsc::WeakSender<NN>: !Send & !Sync & Unpin);
assert_value!(tokio::sync::mpsc::WeakSender<YN>: Send & Sync & Unpin);
assert_value!(tokio::sync::mpsc::WeakSender<YY>: Send & Sync & Unpin);
assert_value!(tokio::sync::mpsc::WeakUnboundedSender<NN>: !Send & !Sync & Unpin);
assert_value!(tokio::sync::mpsc::WeakUnboundedSender<YN>: Send & Sync & Unpin);
assert_value!(tokio::sync::mpsc::WeakUnboundedSender<YY>: Send & Sync & Unpin);
assert_value!(tokio::sync::mpsc::error::SendError<NN>: !Send & !Sync & Unpin);
assert_value!(tokio::sync::mpsc::error::SendError<YN>: Send & !Sync & Unpin);
assert_value!(tokio::sync::mpsc::error::SendError<YY>: Send & Sync & Unpin);
Expand Down
5 changes: 0 additions & 5 deletions tokio/tests/sync_mpsc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ mod support {
pub(crate) mod mpsc_stream;
}

#[allow(unused)]
trait AssertSend: Send {}
impl AssertSend for mpsc::Sender<i32> {}
impl AssertSend for mpsc::Receiver<i32> {}

#[allow(unused)]
trait AssertRefUnwindSafe: panic::RefUnwindSafe {}
impl<T> AssertRefUnwindSafe for mpsc::OwnedPermit<T> {}
Expand Down

0 comments on commit 28119cc

Please sign in to comment.