2019-08-10 00:07:57 +09:00
|
|
|
#![warn(rust_2018_idioms)]
|
2022-01-27 14:07:52 +00:00
|
|
|
#![cfg(feature = "sync")]
|
|
|
|
|
|
2023-07-27 18:57:19 +10:00
|
|
|
#[cfg(all(target_family = "wasm", not(target_os = "wasi")))]
|
2022-01-27 14:07:52 +00:00
|
|
|
use wasm_bindgen_test::wasm_bindgen_test as test;
|
2019-03-01 12:24:17 -08:00
|
|
|
|
2020-01-06 19:04:21 +01:00
|
|
|
fn is_error<T: std::error::Error + Send + Sync>() {}
|
2019-03-01 12:24:17 -08:00
|
|
|
|
|
|
|
|
#[test]
|
2019-03-12 16:51:23 +01:00
|
|
|
fn mpsc_error_bound() {
|
2019-10-29 15:11:31 -07:00
|
|
|
use tokio::sync::mpsc::error;
|
2019-03-12 16:51:23 +01:00
|
|
|
|
2019-11-15 22:11:13 -08:00
|
|
|
is_error::<error::SendError<()>>();
|
2019-03-01 12:24:17 -08:00
|
|
|
is_error::<error::TrySendError<()>>();
|
|
|
|
|
}
|
2019-03-12 16:51:23 +01:00
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
fn oneshot_error_bound() {
|
2019-10-29 15:11:31 -07:00
|
|
|
use tokio::sync::oneshot::error;
|
2019-03-12 16:51:23 +01:00
|
|
|
|
|
|
|
|
is_error::<error::RecvError>();
|
|
|
|
|
is_error::<error::TryRecvError>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
fn watch_error_bound() {
|
2019-10-29 15:11:31 -07:00
|
|
|
use tokio::sync::watch::error;
|
2019-03-12 16:51:23 +01:00
|
|
|
|
|
|
|
|
is_error::<error::SendError<()>>();
|
|
|
|
|
}
|