2018-08-31 14:20:59 +02:00
|
|
|
//@ run-pass
|
|
|
|
|
2024-03-06 12:44:54 -08:00
|
|
|
//@ ignore-wasm32 networking not available
|
2019-04-24 09:26:33 -07:00
|
|
|
//@ ignore-sgx ToSocketAddrs cannot be used for DNS Resolution
|
2022-10-13 21:26:52 +00:00
|
|
|
//@ ignore-fuchsia Req. test-harness networking privileges
|
2017-10-22 20:01:00 -07:00
|
|
|
|
2018-05-03 16:24:21 -07:00
|
|
|
use std::net::ToSocketAddrs;
|
2015-08-24 23:01:31 +02:00
|
|
|
|
2024-08-24 05:32:52 +02:00
|
|
|
fn is_sync<T>(_: T)
|
|
|
|
where
|
|
|
|
T: Sync,
|
|
|
|
{
|
|
|
|
}
|
|
|
|
fn is_send<T>(_: T)
|
|
|
|
where
|
|
|
|
T: Send,
|
|
|
|
{
|
|
|
|
}
|
2015-08-24 23:01:31 +02:00
|
|
|
|
|
|
|
macro_rules! all_sync_send {
|
|
|
|
($ctor:expr, $($iter:ident),+) => ({
|
|
|
|
$(
|
|
|
|
let mut x = $ctor;
|
|
|
|
is_sync(x.$iter());
|
|
|
|
let mut y = $ctor;
|
|
|
|
is_send(y.$iter());
|
|
|
|
)+
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2018-05-03 16:24:21 -07:00
|
|
|
all_sync_send!("localhost:80".to_socket_addrs().unwrap(), next);
|
2015-08-24 23:01:31 +02:00
|
|
|
}
|