]> git.proxmox.com Git - rustc.git/blob - src/test/ui/threads-sendsync/sync-send-in-std.rs
New upstream version 1.66.0+dfsg1
[rustc.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 // ignore-fuchsia Req. test-harness networking privileges
6
7 use std::net::ToSocketAddrs;
8
9 fn is_sync<T>(_: T) where T: Sync {}
10 fn is_send<T>(_: T) where T: Send {}
11
12 macro_rules! all_sync_send {
13 ($ctor:expr, $($iter:ident),+) => ({
14 $(
15 let mut x = $ctor;
16 is_sync(x.$iter());
17 let mut y = $ctor;
18 is_send(y.$iter());
19 )+
20 })
21 }
22
23 fn main() {
24 all_sync_send!("localhost:80".to_socket_addrs().unwrap(), next);
25 }