mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-06 00:00:10 +02:00
18 lines
416 B
Rust
18 lines
416 B
Rust
use tokio_executor::{with_default, DefaultExecutor};
|
|||
|
|
|
||
|
|
#[test]
|
||
|
|
fn default_executor_is_send_and_sync() {
|
||
|
|
fn assert_send_sync<T: Send + Sync>() {}
|
||
|
|
|
||
|
|
assert_send_sync::<DefaultExecutor>();
|
||
|
|
}
|
||
|
|
|
||
|
|
#[test]
|
||
|
|
#[should_panic]
|
||
|
|
fn nested_default_executor_status() {
|
||
|
|
let _enter = tokio_executor::enter().unwrap();
|
||
|
|
let mut executor = DefaultExecutor::current();
|
||
|
|
|
||
|
|
let _result = with_default(&mut executor, || ());
|
||
|
|
}
|