mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-26 00:00:16 +02:00
A step towards collapsing Tokio sub crates into a single `tokio` crate (#1318). The sync implementation is now provided by the main `tokio` crate. Functionality can be opted out of by using the various net related feature flags.
30 lines
637 B
Rust
30 lines
637 B
Rust
#![warn(rust_2018_idioms)]
|
|
|
|
fn is_error<T: ::std::error::Error + Send + Sync>() {}
|
|
|
|
#[test]
|
|
fn mpsc_error_bound() {
|
|
use tokio::sync::mpsc::error;
|
|
|
|
is_error::<error::SendError>();
|
|
is_error::<error::TrySendError<()>>();
|
|
is_error::<error::UnboundedRecvError>();
|
|
is_error::<error::UnboundedSendError>();
|
|
is_error::<error::UnboundedTrySendError<()>>();
|
|
}
|
|
|
|
#[test]
|
|
fn oneshot_error_bound() {
|
|
use tokio::sync::oneshot::error;
|
|
|
|
is_error::<error::RecvError>();
|
|
is_error::<error::TryRecvError>();
|
|
}
|
|
|
|
#[test]
|
|
fn watch_error_bound() {
|
|
use tokio::sync::watch::error;
|
|
|
|
is_error::<error::SendError<()>>();
|
|
}
|