]> git.lizzy.rs Git - rust.git/blob - src/test/ui/threads-sendsync/sync-send-in-std.rs
Merge commit 'e18101137866b79045fee0ef996e696e68c920b4' into clippyup
[rust.git] / src / test / ui / threads-sendsync / sync-send-in-std.rs
1 // run-pass
2
3 // ignore-wasm32-bare networking not available
4 // ignore-sgx ToSocketAddrs cannot be used for DNS Resolution
5
6 use std::net::ToSocketAddrs;
7
8 fn is_sync<T>(_: T) where T: Sync {}
9 fn is_send<T>(_: T) where T: Send {}
10
11 macro_rules! all_sync_send {
12     ($ctor:expr, $($iter:ident),+) => ({
13         $(
14             let mut x = $ctor;
15             is_sync(x.$iter());
16             let mut y = $ctor;
17             is_send(y.$iter());
18         )+
19     })
20 }
21
22 fn main() {
23     all_sync_send!("localhost:80".to_socket_addrs().unwrap(), next);
24 }