Files
tokio/tokio/tests/sync_errors.rs
T
Carl Lerche 2b909d6805 sync: move into tokio crate (#1705)
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.
2019-10-29 15:11:31 -07:00

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<()>>();
}