mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-09-28 12:10:37 +00:00

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.
30 lines
644 B
Rust
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<()>>();
|
|
}
|