tokio/tokio-sync/tests/errors.rs
Carl Lerche 06c473e628
Update Tokio to use std::future. (#1120)
A first pass at updating Tokio to use `std::future`.

Implementations of `Future` from the futures crate are updated to implement
`Future` from std. Implementations of `Stream` are moved to a feature flag.

This commits disables a number of crates that have not yet been updated.
2019-06-24 12:34:30 -07:00

30 lines
644 B
Rust

#![deny(warnings, 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<()>>();
}