2019-05-14 10:27:36 -07:00
|
|
|
#![deny(warnings, rust_2018_idioms)]
|
2019-03-01 12:24:17 -08:00
|
|
|
|
|
|
|
|
fn is_error<T: ::std::error::Error + Send + Sync>() {}
|
|
|
|
|
|
|
|
|
|
#[test]
|
2019-03-12 16:51:23 +01:00
|
|
|
fn mpsc_error_bound() {
|
|
|
|
|
use tokio_sync::mpsc::error;
|
|
|
|
|
|
2019-03-01 12:24:17 -08:00
|
|
|
is_error::<error::SendError>();
|
|
|
|
|
is_error::<error::TrySendError<()>>();
|
|
|
|
|
is_error::<error::UnboundedRecvError>();
|
|
|
|
|
is_error::<error::UnboundedSendError>();
|
|
|
|
|
is_error::<error::UnboundedTrySendError<()>>();
|
|
|
|
|
}
|
2019-03-12 16:51:23 +01:00
|
|
|
|
|
|
|
|
#[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<()>>();
|
|
|
|
|
}
|