1 #![warn(rust_2018_idioms)]
2 #![cfg(feature = "full")]
3 #![allow(clippy::type_complexity, clippy::diverging_sub_expression)]
4 
5 use std::cell::Cell;
6 use std::future::Future;
7 use std::io::SeekFrom;
8 use std::net::SocketAddr;
9 use std::pin::Pin;
10 use std::rc::Rc;
11 use tokio::net::TcpStream;
12 use tokio::time::{Duration, Instant};
13 
14 // The names of these structs behaves better when sorted.
15 // Send: Yes, Sync: Yes
16 #[derive(Clone)]
17 struct YY {}
18 
19 // Send: Yes, Sync: No
20 #[derive(Clone)]
21 struct YN {
22     _value: Cell<u8>,
23 }
24 
25 // Send: No, Sync: No
26 #[derive(Clone)]
27 struct NN {
28     _value: Rc<u8>,
29 }
30 
31 #[allow(dead_code)]
32 type BoxFutureSync<T> = std::pin::Pin<Box<dyn std::future::Future<Output = T> + Send + Sync>>;
33 #[allow(dead_code)]
34 type BoxFutureSend<T> = std::pin::Pin<Box<dyn std::future::Future<Output = T> + Send>>;
35 #[allow(dead_code)]
36 type BoxFuture<T> = std::pin::Pin<Box<dyn std::future::Future<Output = T>>>;
37 
38 #[allow(dead_code)]
39 type BoxAsyncRead = std::pin::Pin<Box<dyn tokio::io::AsyncBufRead + Send + Sync>>;
40 #[allow(dead_code)]
41 type BoxAsyncSeek = std::pin::Pin<Box<dyn tokio::io::AsyncSeek + Send + Sync>>;
42 #[allow(dead_code)]
43 type BoxAsyncWrite = std::pin::Pin<Box<dyn tokio::io::AsyncWrite + Send + Sync>>;
44 
45 #[allow(dead_code)]
require_send<T: Send>(_t: &T)46 fn require_send<T: Send>(_t: &T) {}
47 #[allow(dead_code)]
require_sync<T: Sync>(_t: &T)48 fn require_sync<T: Sync>(_t: &T) {}
49 #[allow(dead_code)]
require_unpin<T: Unpin>(_t: &T)50 fn require_unpin<T: Unpin>(_t: &T) {}
51 
52 #[allow(dead_code)]
53 struct Invalid;
54 
55 trait AmbiguousIfSend<A> {
some_item(&self)56     fn some_item(&self) {}
57 }
58 impl<T: ?Sized> AmbiguousIfSend<()> for T {}
59 impl<T: ?Sized + Send> AmbiguousIfSend<Invalid> for T {}
60 
61 trait AmbiguousIfSync<A> {
some_item(&self)62     fn some_item(&self) {}
63 }
64 impl<T: ?Sized> AmbiguousIfSync<()> for T {}
65 impl<T: ?Sized + Sync> AmbiguousIfSync<Invalid> for T {}
66 
67 trait AmbiguousIfUnpin<A> {
some_item(&self)68     fn some_item(&self) {}
69 }
70 impl<T: ?Sized> AmbiguousIfUnpin<()> for T {}
71 impl<T: ?Sized + Unpin> AmbiguousIfUnpin<Invalid> for T {}
72 
73 macro_rules! into_todo {
74     ($typ:ty) => {{
75         let x: $typ = todo!();
76         x
77     }};
78 }
79 
80 macro_rules! async_assert_fn_send {
81     (Send & $(!)?Sync & $(!)?Unpin, $value:expr) => {
82         require_send(&$value);
83     };
84     (!Send & $(!)?Sync & $(!)?Unpin, $value:expr) => {
85         AmbiguousIfSend::some_item(&$value);
86     };
87 }
88 macro_rules! async_assert_fn_sync {
89     ($(!)?Send & Sync & $(!)?Unpin, $value:expr) => {
90         require_sync(&$value);
91     };
92     ($(!)?Send & !Sync & $(!)?Unpin, $value:expr) => {
93         AmbiguousIfSync::some_item(&$value);
94     };
95 }
96 macro_rules! async_assert_fn_unpin {
97     ($(!)?Send & $(!)?Sync & Unpin, $value:expr) => {
98         require_unpin(&$value);
99     };
100     ($(!)?Send & $(!)?Sync & !Unpin, $value:expr) => {
101         AmbiguousIfUnpin::some_item(&$value);
102     };
103 }
104 
105 macro_rules! async_assert_fn {
106     ($($f:ident $(< $($generic:ty),* > )? )::+($($arg:ty),*): $($tok:tt)*) => {
107         #[allow(unreachable_code)]
108         #[allow(unused_variables)]
109         const _: fn() = || {
110             let f = $($f $(::<$($generic),*>)? )::+( $( into_todo!($arg) ),* );
111             async_assert_fn_send!($($tok)*, f);
112             async_assert_fn_sync!($($tok)*, f);
113             async_assert_fn_unpin!($($tok)*, f);
114         };
115     };
116 }
117 macro_rules! assert_value {
118     ($type:ty: $($tok:tt)*) => {
119         #[allow(unreachable_code)]
120         #[allow(unused_variables)]
121         const _: fn() = || {
122             let f: $type = todo!();
123             async_assert_fn_send!($($tok)*, f);
124             async_assert_fn_sync!($($tok)*, f);
125             async_assert_fn_unpin!($($tok)*, f);
126         };
127     };
128 }
129 
130 assert_value!(tokio::fs::DirBuilder: Send & Sync & Unpin);
131 assert_value!(tokio::fs::DirEntry: Send & Sync & Unpin);
132 assert_value!(tokio::fs::File: Send & Sync & Unpin);
133 assert_value!(tokio::fs::OpenOptions: Send & Sync & Unpin);
134 assert_value!(tokio::fs::ReadDir: Send & Sync & Unpin);
135 
136 async_assert_fn!(tokio::fs::canonicalize(&str): Send & Sync & !Unpin);
137 async_assert_fn!(tokio::fs::copy(&str, &str): Send & Sync & !Unpin);
138 async_assert_fn!(tokio::fs::create_dir(&str): Send & Sync & !Unpin);
139 async_assert_fn!(tokio::fs::create_dir_all(&str): Send & Sync & !Unpin);
140 async_assert_fn!(tokio::fs::hard_link(&str, &str): Send & Sync & !Unpin);
141 async_assert_fn!(tokio::fs::metadata(&str): Send & Sync & !Unpin);
142 async_assert_fn!(tokio::fs::read(&str): Send & Sync & !Unpin);
143 async_assert_fn!(tokio::fs::read_dir(&str): Send & Sync & !Unpin);
144 async_assert_fn!(tokio::fs::read_link(&str): Send & Sync & !Unpin);
145 async_assert_fn!(tokio::fs::read_to_string(&str): Send & Sync & !Unpin);
146 async_assert_fn!(tokio::fs::remove_dir(&str): Send & Sync & !Unpin);
147 async_assert_fn!(tokio::fs::remove_dir_all(&str): Send & Sync & !Unpin);
148 async_assert_fn!(tokio::fs::remove_file(&str): Send & Sync & !Unpin);
149 async_assert_fn!(tokio::fs::rename(&str, &str): Send & Sync & !Unpin);
150 async_assert_fn!(tokio::fs::set_permissions(&str, std::fs::Permissions): Send & Sync & !Unpin);
151 async_assert_fn!(tokio::fs::symlink_metadata(&str): Send & Sync & !Unpin);
152 async_assert_fn!(tokio::fs::write(&str, Vec<u8>): Send & Sync & !Unpin);
153 async_assert_fn!(tokio::fs::ReadDir::next_entry(_): Send & Sync & !Unpin);
154 async_assert_fn!(tokio::fs::OpenOptions::open(_, &str): Send & Sync & !Unpin);
155 async_assert_fn!(tokio::fs::DirBuilder::create(_, &str): Send & Sync & !Unpin);
156 async_assert_fn!(tokio::fs::DirEntry::metadata(_): Send & Sync & !Unpin);
157 async_assert_fn!(tokio::fs::DirEntry::file_type(_): Send & Sync & !Unpin);
158 async_assert_fn!(tokio::fs::File::open(&str): Send & Sync & !Unpin);
159 async_assert_fn!(tokio::fs::File::create(&str): Send & Sync & !Unpin);
160 async_assert_fn!(tokio::fs::File::sync_all(_): Send & Sync & !Unpin);
161 async_assert_fn!(tokio::fs::File::sync_data(_): Send & Sync & !Unpin);
162 async_assert_fn!(tokio::fs::File::set_len(_, u64): Send & Sync & !Unpin);
163 async_assert_fn!(tokio::fs::File::metadata(_): Send & Sync & !Unpin);
164 async_assert_fn!(tokio::fs::File::try_clone(_): Send & Sync & !Unpin);
165 async_assert_fn!(tokio::fs::File::into_std(_): Send & Sync & !Unpin);
166 async_assert_fn!(tokio::fs::File::set_permissions(_, std::fs::Permissions): Send & Sync & !Unpin);
167 
168 assert_value!(tokio::net::TcpListener: Send & Sync & Unpin);
169 assert_value!(tokio::net::TcpSocket: Send & Sync & Unpin);
170 assert_value!(tokio::net::TcpStream: Send & Sync & Unpin);
171 assert_value!(tokio::net::UdpSocket: Send & Sync & Unpin);
172 assert_value!(tokio::net::tcp::OwnedReadHalf: Send & Sync & Unpin);
173 assert_value!(tokio::net::tcp::OwnedWriteHalf: Send & Sync & Unpin);
174 assert_value!(tokio::net::tcp::ReadHalf<'_>: Send & Sync & Unpin);
175 assert_value!(tokio::net::tcp::ReuniteError: Send & Sync & Unpin);
176 assert_value!(tokio::net::tcp::WriteHalf<'_>: Send & Sync & Unpin);
177 async_assert_fn!(tokio::net::TcpListener::accept(_): Send & Sync & !Unpin);
178 async_assert_fn!(tokio::net::TcpListener::bind(SocketAddr): Send & Sync & !Unpin);
179 async_assert_fn!(tokio::net::TcpStream::connect(SocketAddr): Send & Sync & !Unpin);
180 async_assert_fn!(tokio::net::TcpStream::peek(_, &mut [u8]): Send & Sync & !Unpin);
181 async_assert_fn!(tokio::net::TcpStream::readable(_): Send & Sync & !Unpin);
182 async_assert_fn!(tokio::net::TcpStream::ready(_, tokio::io::Interest): Send & Sync & !Unpin);
183 async_assert_fn!(tokio::net::TcpStream::writable(_): Send & Sync & !Unpin);
184 async_assert_fn!(tokio::net::UdpSocket::bind(SocketAddr): Send & Sync & !Unpin);
185 async_assert_fn!(tokio::net::UdpSocket::connect(_, SocketAddr): Send & Sync & !Unpin);
186 async_assert_fn!(tokio::net::UdpSocket::peek_from(_, &mut [u8]): Send & Sync & !Unpin);
187 async_assert_fn!(tokio::net::UdpSocket::readable(_): Send & Sync & !Unpin);
188 async_assert_fn!(tokio::net::UdpSocket::ready(_, tokio::io::Interest): Send & Sync & !Unpin);
189 async_assert_fn!(tokio::net::UdpSocket::recv(_, &mut [u8]): Send & Sync & !Unpin);
190 async_assert_fn!(tokio::net::UdpSocket::recv_from(_, &mut [u8]): Send & Sync & !Unpin);
191 async_assert_fn!(tokio::net::UdpSocket::send(_, &[u8]): Send & Sync & !Unpin);
192 async_assert_fn!(tokio::net::UdpSocket::send_to(_, &[u8], SocketAddr): Send & Sync & !Unpin);
193 async_assert_fn!(tokio::net::UdpSocket::writable(_): Send & Sync & !Unpin);
194 async_assert_fn!(tokio::net::lookup_host(SocketAddr): Send & Sync & !Unpin);
195 async_assert_fn!(tokio::net::tcp::ReadHalf::peek(_, &mut [u8]): Send & Sync & !Unpin);
196 
197 #[cfg(unix)]
198 mod unix_datagram {
199     use super::*;
200     use tokio::net::*;
201     assert_value!(UnixDatagram: Send & Sync & Unpin);
202     assert_value!(UnixListener: Send & Sync & Unpin);
203     assert_value!(UnixStream: Send & Sync & Unpin);
204     assert_value!(unix::OwnedReadHalf: Send & Sync & Unpin);
205     assert_value!(unix::OwnedWriteHalf: Send & Sync & Unpin);
206     assert_value!(unix::ReadHalf<'_>: Send & Sync & Unpin);
207     assert_value!(unix::ReuniteError: Send & Sync & Unpin);
208     assert_value!(unix::SocketAddr: Send & Sync & Unpin);
209     assert_value!(unix::UCred: Send & Sync & Unpin);
210     assert_value!(unix::WriteHalf<'_>: Send & Sync & Unpin);
211     async_assert_fn!(UnixDatagram::readable(_): Send & Sync & !Unpin);
212     async_assert_fn!(UnixDatagram::ready(_, tokio::io::Interest): Send & Sync & !Unpin);
213     async_assert_fn!(UnixDatagram::recv(_, &mut [u8]): Send & Sync & !Unpin);
214     async_assert_fn!(UnixDatagram::recv_from(_, &mut [u8]): Send & Sync & !Unpin);
215     async_assert_fn!(UnixDatagram::send(_, &[u8]): Send & Sync & !Unpin);
216     async_assert_fn!(UnixDatagram::send_to(_, &[u8], &str): Send & Sync & !Unpin);
217     async_assert_fn!(UnixDatagram::writable(_): Send & Sync & !Unpin);
218     async_assert_fn!(UnixListener::accept(_): Send & Sync & !Unpin);
219     async_assert_fn!(UnixStream::connect(&str): Send & Sync & !Unpin);
220     async_assert_fn!(UnixStream::readable(_): Send & Sync & !Unpin);
221     async_assert_fn!(UnixStream::ready(_, tokio::io::Interest): Send & Sync & !Unpin);
222     async_assert_fn!(UnixStream::writable(_): Send & Sync & !Unpin);
223 }
224 
225 #[cfg(windows)]
226 mod windows_named_pipe {
227     use super::*;
228     use tokio::net::windows::named_pipe::*;
229     assert_value!(ClientOptions: Send & Sync & Unpin);
230     assert_value!(NamedPipeClient: Send & Sync & Unpin);
231     assert_value!(NamedPipeServer: Send & Sync & Unpin);
232     assert_value!(PipeEnd: Send & Sync & Unpin);
233     assert_value!(PipeInfo: Send & Sync & Unpin);
234     assert_value!(PipeMode: Send & Sync & Unpin);
235     assert_value!(ServerOptions: Send & Sync & Unpin);
236     async_assert_fn!(NamedPipeClient::readable(_): Send & Sync & !Unpin);
237     async_assert_fn!(NamedPipeClient::ready(_, tokio::io::Interest): Send & Sync & !Unpin);
238     async_assert_fn!(NamedPipeClient::writable(_): Send & Sync & !Unpin);
239     async_assert_fn!(NamedPipeServer::connect(_): Send & Sync & !Unpin);
240     async_assert_fn!(NamedPipeServer::readable(_): Send & Sync & !Unpin);
241     async_assert_fn!(NamedPipeServer::ready(_, tokio::io::Interest): Send & Sync & !Unpin);
242     async_assert_fn!(NamedPipeServer::writable(_): Send & Sync & !Unpin);
243 }
244 
245 assert_value!(tokio::process::Child: Send & Sync & Unpin);
246 assert_value!(tokio::process::ChildStderr: Send & Sync & Unpin);
247 assert_value!(tokio::process::ChildStdin: Send & Sync & Unpin);
248 assert_value!(tokio::process::ChildStdout: Send & Sync & Unpin);
249 assert_value!(tokio::process::Command: Send & Sync & Unpin);
250 async_assert_fn!(tokio::process::Child::kill(_): Send & Sync & !Unpin);
251 async_assert_fn!(tokio::process::Child::wait(_): Send & Sync & !Unpin);
252 async_assert_fn!(tokio::process::Child::wait_with_output(_): Send & Sync & !Unpin);
253 
254 async_assert_fn!(tokio::signal::ctrl_c(): Send & Sync & !Unpin);
255 #[cfg(unix)]
256 mod unix_signal {
257     use super::*;
258     assert_value!(tokio::signal::unix::Signal: Send & Sync & Unpin);
259     assert_value!(tokio::signal::unix::SignalKind: Send & Sync & Unpin);
260     async_assert_fn!(tokio::signal::unix::Signal::recv(_): Send & Sync & !Unpin);
261 }
262 #[cfg(windows)]
263 mod windows_signal {
264     use super::*;
265     assert_value!(tokio::signal::windows::CtrlC: Send & Sync & Unpin);
266     assert_value!(tokio::signal::windows::CtrlBreak: Send & Sync & Unpin);
267     async_assert_fn!(tokio::signal::windows::CtrlC::recv(_): Send & Sync & !Unpin);
268     async_assert_fn!(tokio::signal::windows::CtrlBreak::recv(_): Send & Sync & !Unpin);
269 }
270 
271 assert_value!(tokio::sync::AcquireError: Send & Sync & Unpin);
272 assert_value!(tokio::sync::Barrier: Send & Sync & Unpin);
273 assert_value!(tokio::sync::BarrierWaitResult: Send & Sync & Unpin);
274 assert_value!(tokio::sync::MappedMutexGuard<'_, NN>: !Send & !Sync & Unpin);
275 assert_value!(tokio::sync::MappedMutexGuard<'_, YN>: Send & !Sync & Unpin);
276 assert_value!(tokio::sync::MappedMutexGuard<'_, YY>: Send & Sync & Unpin);
277 assert_value!(tokio::sync::Mutex<NN>: !Send & !Sync & Unpin);
278 assert_value!(tokio::sync::Mutex<YN>: Send & Sync & Unpin);
279 assert_value!(tokio::sync::Mutex<YY>: Send & Sync & Unpin);
280 assert_value!(tokio::sync::MutexGuard<'_, NN>: !Send & !Sync & Unpin);
281 assert_value!(tokio::sync::MutexGuard<'_, YN>: Send & !Sync & Unpin);
282 assert_value!(tokio::sync::MutexGuard<'_, YY>: Send & Sync & Unpin);
283 assert_value!(tokio::sync::Notify: Send & Sync & Unpin);
284 assert_value!(tokio::sync::OnceCell<NN>: !Send & !Sync & Unpin);
285 assert_value!(tokio::sync::OnceCell<YN>: Send & !Sync & Unpin);
286 assert_value!(tokio::sync::OnceCell<YY>: Send & Sync & Unpin);
287 assert_value!(tokio::sync::OwnedMutexGuard<NN>: !Send & !Sync & Unpin);
288 assert_value!(tokio::sync::OwnedMutexGuard<YN>: Send & !Sync & Unpin);
289 assert_value!(tokio::sync::OwnedMutexGuard<YY>: Send & Sync & Unpin);
290 assert_value!(tokio::sync::OwnedRwLockMappedWriteGuard<NN>: !Send & !Sync & Unpin);
291 assert_value!(tokio::sync::OwnedRwLockMappedWriteGuard<YN>: !Send & !Sync & Unpin);
292 assert_value!(tokio::sync::OwnedRwLockMappedWriteGuard<YY>: Send & Sync & Unpin);
293 assert_value!(tokio::sync::OwnedRwLockReadGuard<NN>: !Send & !Sync & Unpin);
294 assert_value!(tokio::sync::OwnedRwLockReadGuard<YN>: !Send & !Sync & Unpin);
295 assert_value!(tokio::sync::OwnedRwLockReadGuard<YY>: Send & Sync & Unpin);
296 assert_value!(tokio::sync::OwnedRwLockWriteGuard<NN>: !Send & !Sync & Unpin);
297 assert_value!(tokio::sync::OwnedRwLockWriteGuard<YN>: !Send & !Sync & Unpin);
298 assert_value!(tokio::sync::OwnedRwLockWriteGuard<YY>: Send & Sync & Unpin);
299 assert_value!(tokio::sync::OwnedSemaphorePermit: Send & Sync & Unpin);
300 assert_value!(tokio::sync::RwLock<NN>: !Send & !Sync & Unpin);
301 assert_value!(tokio::sync::RwLock<YN>: Send & !Sync & Unpin);
302 assert_value!(tokio::sync::RwLock<YY>: Send & Sync & Unpin);
303 assert_value!(tokio::sync::RwLockMappedWriteGuard<'_, NN>: !Send & !Sync & Unpin);
304 assert_value!(tokio::sync::RwLockMappedWriteGuard<'_, YN>: !Send & !Sync & Unpin);
305 assert_value!(tokio::sync::RwLockMappedWriteGuard<'_, YY>: Send & Sync & Unpin);
306 assert_value!(tokio::sync::RwLockReadGuard<'_, NN>: !Send & !Sync & Unpin);
307 assert_value!(tokio::sync::RwLockReadGuard<'_, YN>: !Send & !Sync & Unpin);
308 assert_value!(tokio::sync::RwLockReadGuard<'_, YY>: Send & Sync & Unpin);
309 assert_value!(tokio::sync::RwLockWriteGuard<'_, NN>: !Send & !Sync & Unpin);
310 assert_value!(tokio::sync::RwLockWriteGuard<'_, YN>: !Send & !Sync & Unpin);
311 assert_value!(tokio::sync::RwLockWriteGuard<'_, YY>: Send & Sync & Unpin);
312 assert_value!(tokio::sync::Semaphore: Send & Sync & Unpin);
313 assert_value!(tokio::sync::SemaphorePermit<'_>: Send & Sync & Unpin);
314 assert_value!(tokio::sync::TryAcquireError: Send & Sync & Unpin);
315 assert_value!(tokio::sync::TryLockError: Send & Sync & Unpin);
316 assert_value!(tokio::sync::broadcast::Receiver<NN>: !Send & !Sync & Unpin);
317 assert_value!(tokio::sync::broadcast::Receiver<YN>: Send & Sync & Unpin);
318 assert_value!(tokio::sync::broadcast::Receiver<YY>: Send & Sync & Unpin);
319 assert_value!(tokio::sync::broadcast::Sender<NN>: !Send & !Sync & Unpin);
320 assert_value!(tokio::sync::broadcast::Sender<YN>: Send & Sync & Unpin);
321 assert_value!(tokio::sync::broadcast::Sender<YY>: Send & Sync & Unpin);
322 assert_value!(tokio::sync::futures::Notified<'_>: Send & Sync & !Unpin);
323 assert_value!(tokio::sync::mpsc::OwnedPermit<NN>: !Send & !Sync & Unpin);
324 assert_value!(tokio::sync::mpsc::OwnedPermit<YN>: Send & Sync & Unpin);
325 assert_value!(tokio::sync::mpsc::OwnedPermit<YY>: Send & Sync & Unpin);
326 assert_value!(tokio::sync::mpsc::Permit<'_, NN>: !Send & !Sync & Unpin);
327 assert_value!(tokio::sync::mpsc::Permit<'_, YN>: Send & Sync & Unpin);
328 assert_value!(tokio::sync::mpsc::Permit<'_, YY>: Send & Sync & Unpin);
329 assert_value!(tokio::sync::mpsc::Receiver<NN>: !Send & !Sync & Unpin);
330 assert_value!(tokio::sync::mpsc::Receiver<YN>: Send & Sync & Unpin);
331 assert_value!(tokio::sync::mpsc::Receiver<YY>: Send & Sync & Unpin);
332 assert_value!(tokio::sync::mpsc::Sender<NN>: !Send & !Sync & Unpin);
333 assert_value!(tokio::sync::mpsc::Sender<YN>: Send & Sync & Unpin);
334 assert_value!(tokio::sync::mpsc::Sender<YY>: Send & Sync & Unpin);
335 assert_value!(tokio::sync::mpsc::UnboundedReceiver<NN>: !Send & !Sync & Unpin);
336 assert_value!(tokio::sync::mpsc::UnboundedReceiver<YN>: Send & Sync & Unpin);
337 assert_value!(tokio::sync::mpsc::UnboundedReceiver<YY>: Send & Sync & Unpin);
338 assert_value!(tokio::sync::mpsc::UnboundedSender<NN>: !Send & !Sync & Unpin);
339 assert_value!(tokio::sync::mpsc::UnboundedSender<YN>: Send & Sync & Unpin);
340 assert_value!(tokio::sync::mpsc::UnboundedSender<YY>: Send & Sync & Unpin);
341 assert_value!(tokio::sync::mpsc::error::SendError<NN>: !Send & !Sync & Unpin);
342 assert_value!(tokio::sync::mpsc::error::SendError<YN>: Send & !Sync & Unpin);
343 assert_value!(tokio::sync::mpsc::error::SendError<YY>: Send & Sync & Unpin);
344 assert_value!(tokio::sync::mpsc::error::SendTimeoutError<NN>: !Send & !Sync & Unpin);
345 assert_value!(tokio::sync::mpsc::error::SendTimeoutError<YN>: Send & !Sync & Unpin);
346 assert_value!(tokio::sync::mpsc::error::SendTimeoutError<YY>: Send & Sync & Unpin);
347 assert_value!(tokio::sync::mpsc::error::TrySendError<NN>: !Send & !Sync & Unpin);
348 assert_value!(tokio::sync::mpsc::error::TrySendError<YN>: Send & !Sync & Unpin);
349 assert_value!(tokio::sync::mpsc::error::TrySendError<YY>: Send & Sync & Unpin);
350 assert_value!(tokio::sync::oneshot::Receiver<NN>: !Send & !Sync & Unpin);
351 assert_value!(tokio::sync::oneshot::Receiver<YN>: Send & Sync & Unpin);
352 assert_value!(tokio::sync::oneshot::Receiver<YY>: Send & Sync & Unpin);
353 assert_value!(tokio::sync::oneshot::Sender<NN>: !Send & !Sync & Unpin);
354 assert_value!(tokio::sync::oneshot::Sender<YN>: Send & Sync & Unpin);
355 assert_value!(tokio::sync::oneshot::Sender<YY>: Send & Sync & Unpin);
356 assert_value!(tokio::sync::watch::Receiver<NN>: !Send & !Sync & Unpin);
357 assert_value!(tokio::sync::watch::Receiver<YN>: !Send & !Sync & Unpin);
358 assert_value!(tokio::sync::watch::Receiver<YY>: Send & Sync & Unpin);
359 assert_value!(tokio::sync::watch::Ref<'_, NN>: !Send & !Sync & Unpin);
360 assert_value!(tokio::sync::watch::Ref<'_, YN>: !Send & !Sync & Unpin);
361 assert_value!(tokio::sync::watch::Ref<'_, YY>: !Send & Sync & Unpin);
362 assert_value!(tokio::sync::watch::Sender<NN>: !Send & !Sync & Unpin);
363 assert_value!(tokio::sync::watch::Sender<YN>: !Send & !Sync & Unpin);
364 assert_value!(tokio::sync::watch::Sender<YY>: Send & Sync & Unpin);
365 async_assert_fn!(tokio::sync::Barrier::wait(_): Send & Sync & !Unpin);
366 async_assert_fn!(tokio::sync::Mutex<NN>::lock(_): !Send & !Sync & !Unpin);
367 async_assert_fn!(tokio::sync::Mutex<NN>::lock_owned(_): !Send & !Sync & !Unpin);
368 async_assert_fn!(tokio::sync::Mutex<YN>::lock(_): Send & Sync & !Unpin);
369 async_assert_fn!(tokio::sync::Mutex<YN>::lock_owned(_): Send & Sync & !Unpin);
370 async_assert_fn!(tokio::sync::Mutex<YY>::lock(_): Send & Sync & !Unpin);
371 async_assert_fn!(tokio::sync::Mutex<YY>::lock_owned(_): Send & Sync & !Unpin);
372 async_assert_fn!(tokio::sync::Notify::notified(_): Send & Sync & !Unpin);
373 async_assert_fn!(tokio::sync::OnceCell<NN>::get_or_init( _, fn() -> Pin<Box<dyn Future<Output = NN> + Send + Sync>>): !Send & !Sync & !Unpin);
374 async_assert_fn!(tokio::sync::OnceCell<NN>::get_or_init( _, fn() -> Pin<Box<dyn Future<Output = NN> + Send>>): !Send & !Sync & !Unpin);
375 async_assert_fn!(tokio::sync::OnceCell<NN>::get_or_init( _, fn() -> Pin<Box<dyn Future<Output = NN>>>): !Send & !Sync & !Unpin);
376 async_assert_fn!(tokio::sync::OnceCell<NN>::get_or_try_init( _, fn() -> Pin<Box<dyn Future<Output = std::io::Result<NN>> + Send + Sync>>): !Send & !Sync & !Unpin);
377 async_assert_fn!(tokio::sync::OnceCell<NN>::get_or_try_init( _, fn() -> Pin<Box<dyn Future<Output = std::io::Result<NN>> + Send>>): !Send & !Sync & !Unpin);
378 async_assert_fn!(tokio::sync::OnceCell<NN>::get_or_try_init( _, fn() -> Pin<Box<dyn Future<Output = std::io::Result<NN>>>>): !Send & !Sync & !Unpin);
379 async_assert_fn!(tokio::sync::OnceCell<YN>::get_or_init( _, fn() -> Pin<Box<dyn Future<Output = YN> + Send + Sync>>): !Send & !Sync & !Unpin);
380 async_assert_fn!(tokio::sync::OnceCell<YN>::get_or_init( _, fn() -> Pin<Box<dyn Future<Output = YN> + Send>>): !Send & !Sync & !Unpin);
381 async_assert_fn!(tokio::sync::OnceCell<YN>::get_or_init( _, fn() -> Pin<Box<dyn Future<Output = YN>>>): !Send & !Sync & !Unpin);
382 async_assert_fn!(tokio::sync::OnceCell<YN>::get_or_try_init( _, fn() -> Pin<Box<dyn Future<Output = std::io::Result<YN>> + Send + Sync>>): !Send & !Sync & !Unpin);
383 async_assert_fn!(tokio::sync::OnceCell<YN>::get_or_try_init( _, fn() -> Pin<Box<dyn Future<Output = std::io::Result<YN>> + Send>>): !Send & !Sync & !Unpin);
384 async_assert_fn!(tokio::sync::OnceCell<YN>::get_or_try_init( _, fn() -> Pin<Box<dyn Future<Output = std::io::Result<YN>>>>): !Send & !Sync & !Unpin);
385 async_assert_fn!(tokio::sync::OnceCell<YY>::get_or_init( _, fn() -> Pin<Box<dyn Future<Output = YY> + Send + Sync>>): Send & Sync & !Unpin);
386 async_assert_fn!(tokio::sync::OnceCell<YY>::get_or_init( _, fn() -> Pin<Box<dyn Future<Output = YY> + Send>>): Send & !Sync & !Unpin);
387 async_assert_fn!(tokio::sync::OnceCell<YY>::get_or_init( _, fn() -> Pin<Box<dyn Future<Output = YY>>>): !Send & !Sync & !Unpin);
388 async_assert_fn!(tokio::sync::OnceCell<YY>::get_or_try_init( _, fn() -> Pin<Box<dyn Future<Output = std::io::Result<YY>> + Send + Sync>>): Send & Sync & !Unpin);
389 async_assert_fn!(tokio::sync::OnceCell<YY>::get_or_try_init( _, fn() -> Pin<Box<dyn Future<Output = std::io::Result<YY>> + Send>>): Send & !Sync & !Unpin);
390 async_assert_fn!(tokio::sync::OnceCell<YY>::get_or_try_init( _, fn() -> Pin<Box<dyn Future<Output = std::io::Result<YY>>>>): !Send & !Sync & !Unpin);
391 async_assert_fn!(tokio::sync::RwLock<NN>::read(_): !Send & !Sync & !Unpin);
392 async_assert_fn!(tokio::sync::RwLock<NN>::write(_): !Send & !Sync & !Unpin);
393 async_assert_fn!(tokio::sync::RwLock<YN>::read(_): !Send & !Sync & !Unpin);
394 async_assert_fn!(tokio::sync::RwLock<YN>::write(_): !Send & !Sync & !Unpin);
395 async_assert_fn!(tokio::sync::RwLock<YY>::read(_): Send & Sync & !Unpin);
396 async_assert_fn!(tokio::sync::RwLock<YY>::write(_): Send & Sync & !Unpin);
397 async_assert_fn!(tokio::sync::Semaphore::acquire(_): Send & Sync & !Unpin);
398 async_assert_fn!(tokio::sync::Semaphore::acquire_many(_, u32): Send & Sync & !Unpin);
399 async_assert_fn!(tokio::sync::Semaphore::acquire_many_owned(_, u32): Send & Sync & !Unpin);
400 async_assert_fn!(tokio::sync::Semaphore::acquire_owned(_): Send & Sync & !Unpin);
401 async_assert_fn!(tokio::sync::broadcast::Receiver<NN>::recv(_): !Send & !Sync & !Unpin);
402 async_assert_fn!(tokio::sync::broadcast::Receiver<YN>::recv(_): Send & Sync & !Unpin);
403 async_assert_fn!(tokio::sync::broadcast::Receiver<YY>::recv(_): Send & Sync & !Unpin);
404 async_assert_fn!(tokio::sync::mpsc::Receiver<NN>::recv(_): !Send & !Sync & !Unpin);
405 async_assert_fn!(tokio::sync::mpsc::Receiver<YN>::recv(_): Send & Sync & !Unpin);
406 async_assert_fn!(tokio::sync::mpsc::Receiver<YY>::recv(_): Send & Sync & !Unpin);
407 async_assert_fn!(tokio::sync::mpsc::Sender<NN>::closed(_): !Send & !Sync & !Unpin);
408 async_assert_fn!(tokio::sync::mpsc::Sender<NN>::reserve(_): !Send & !Sync & !Unpin);
409 async_assert_fn!(tokio::sync::mpsc::Sender<NN>::reserve_owned(_): !Send & !Sync & !Unpin);
410 async_assert_fn!(tokio::sync::mpsc::Sender<NN>::send(_, NN): !Send & !Sync & !Unpin);
411 async_assert_fn!(tokio::sync::mpsc::Sender<NN>::send_timeout(_, NN, Duration): !Send & !Sync & !Unpin);
412 async_assert_fn!(tokio::sync::mpsc::Sender<YN>::closed(_): Send & Sync & !Unpin);
413 async_assert_fn!(tokio::sync::mpsc::Sender<YN>::reserve(_): Send & Sync & !Unpin);
414 async_assert_fn!(tokio::sync::mpsc::Sender<YN>::reserve_owned(_): Send & Sync & !Unpin);
415 async_assert_fn!(tokio::sync::mpsc::Sender<YN>::send(_, YN): Send & !Sync & !Unpin);
416 async_assert_fn!(tokio::sync::mpsc::Sender<YN>::send_timeout(_, YN, Duration): Send & !Sync & !Unpin);
417 async_assert_fn!(tokio::sync::mpsc::Sender<YY>::closed(_): Send & Sync & !Unpin);
418 async_assert_fn!(tokio::sync::mpsc::Sender<YY>::reserve(_): Send & Sync & !Unpin);
419 async_assert_fn!(tokio::sync::mpsc::Sender<YY>::reserve_owned(_): Send & Sync & !Unpin);
420 async_assert_fn!(tokio::sync::mpsc::Sender<YY>::send(_, YY): Send & Sync & !Unpin);
421 async_assert_fn!(tokio::sync::mpsc::Sender<YY>::send_timeout(_, YY, Duration): Send & Sync & !Unpin);
422 async_assert_fn!(tokio::sync::mpsc::UnboundedReceiver<NN>::recv(_): !Send & !Sync & !Unpin);
423 async_assert_fn!(tokio::sync::mpsc::UnboundedReceiver<YN>::recv(_): Send & Sync & !Unpin);
424 async_assert_fn!(tokio::sync::mpsc::UnboundedReceiver<YY>::recv(_): Send & Sync & !Unpin);
425 async_assert_fn!(tokio::sync::mpsc::UnboundedSender<NN>::closed(_): !Send & !Sync & !Unpin);
426 async_assert_fn!(tokio::sync::mpsc::UnboundedSender<YN>::closed(_): Send & Sync & !Unpin);
427 async_assert_fn!(tokio::sync::mpsc::UnboundedSender<YY>::closed(_): Send & Sync & !Unpin);
428 async_assert_fn!(tokio::sync::oneshot::Sender<NN>::closed(_): !Send & !Sync & !Unpin);
429 async_assert_fn!(tokio::sync::oneshot::Sender<YN>::closed(_): Send & Sync & !Unpin);
430 async_assert_fn!(tokio::sync::oneshot::Sender<YY>::closed(_): Send & Sync & !Unpin);
431 async_assert_fn!(tokio::sync::watch::Receiver<NN>::changed(_): !Send & !Sync & !Unpin);
432 async_assert_fn!(tokio::sync::watch::Receiver<YN>::changed(_): !Send & !Sync & !Unpin);
433 async_assert_fn!(tokio::sync::watch::Receiver<YY>::changed(_): Send & Sync & !Unpin);
434 async_assert_fn!(tokio::sync::watch::Sender<NN>::closed(_): !Send & !Sync & !Unpin);
435 async_assert_fn!(tokio::sync::watch::Sender<YN>::closed(_): !Send & !Sync & !Unpin);
436 async_assert_fn!(tokio::sync::watch::Sender<YY>::closed(_): Send & Sync & !Unpin);
437 
438 async_assert_fn!(tokio::task::LocalKey<u32>::scope(_, u32, BoxFutureSync<()>): Send & Sync & !Unpin);
439 async_assert_fn!(tokio::task::LocalKey<u32>::scope(_, u32, BoxFutureSend<()>): Send & !Sync & !Unpin);
440 async_assert_fn!(tokio::task::LocalKey<u32>::scope(_, u32, BoxFuture<()>): !Send & !Sync & !Unpin);
441 async_assert_fn!(tokio::task::LocalKey<Cell<u32>>::scope(_, Cell<u32>, BoxFutureSync<()>): Send & !Sync & !Unpin);
442 async_assert_fn!(tokio::task::LocalKey<Cell<u32>>::scope(_, Cell<u32>, BoxFutureSend<()>): Send & !Sync & !Unpin);
443 async_assert_fn!(tokio::task::LocalKey<Cell<u32>>::scope(_, Cell<u32>, BoxFuture<()>): !Send & !Sync & !Unpin);
444 async_assert_fn!(tokio::task::LocalKey<Rc<u32>>::scope(_, Rc<u32>, BoxFutureSync<()>): !Send & !Sync & !Unpin);
445 async_assert_fn!(tokio::task::LocalKey<Rc<u32>>::scope(_, Rc<u32>, BoxFutureSend<()>): !Send & !Sync & !Unpin);
446 async_assert_fn!(tokio::task::LocalKey<Rc<u32>>::scope(_, Rc<u32>, BoxFuture<()>): !Send & !Sync & !Unpin);
447 async_assert_fn!(tokio::task::LocalSet::run_until(_, BoxFutureSync<()>): !Send & !Sync & !Unpin);
448 async_assert_fn!(tokio::task::unconstrained(BoxFuture<()>): !Send & !Sync & Unpin);
449 async_assert_fn!(tokio::task::unconstrained(BoxFutureSend<()>): Send & !Sync & Unpin);
450 async_assert_fn!(tokio::task::unconstrained(BoxFutureSync<()>): Send & Sync & Unpin);
451 assert_value!(tokio::task::LocalSet: !Send & !Sync & Unpin);
452 assert_value!(tokio::task::JoinHandle<YY>: Send & Sync & Unpin);
453 assert_value!(tokio::task::JoinHandle<YN>: Send & Sync & Unpin);
454 assert_value!(tokio::task::JoinHandle<NN>: !Send & !Sync & Unpin);
455 assert_value!(tokio::task::JoinError: Send & Sync & Unpin);
456 
457 assert_value!(tokio::runtime::Builder: Send & Sync & Unpin);
458 assert_value!(tokio::runtime::EnterGuard<'_>: Send & Sync & Unpin);
459 assert_value!(tokio::runtime::Handle: Send & Sync & Unpin);
460 assert_value!(tokio::runtime::Runtime: Send & Sync & Unpin);
461 
462 assert_value!(tokio::time::Interval: Send & Sync & Unpin);
463 assert_value!(tokio::time::Instant: Send & Sync & Unpin);
464 assert_value!(tokio::time::Sleep: Send & Sync & !Unpin);
465 assert_value!(tokio::time::Timeout<BoxFutureSync<()>>: Send & Sync & !Unpin);
466 assert_value!(tokio::time::Timeout<BoxFutureSend<()>>: Send & !Sync & !Unpin);
467 assert_value!(tokio::time::Timeout<BoxFuture<()>>: !Send & !Sync & !Unpin);
468 assert_value!(tokio::time::error::Elapsed: Send & Sync & Unpin);
469 assert_value!(tokio::time::error::Error: Send & Sync & Unpin);
470 async_assert_fn!(tokio::time::advance(Duration): Send & Sync & !Unpin);
471 async_assert_fn!(tokio::time::sleep(Duration): Send & Sync & !Unpin);
472 async_assert_fn!(tokio::time::sleep_until(Instant): Send & Sync & !Unpin);
473 async_assert_fn!(tokio::time::timeout(Duration, BoxFutureSync<()>): Send & Sync & !Unpin);
474 async_assert_fn!(tokio::time::timeout(Duration, BoxFutureSend<()>): Send & !Sync & !Unpin);
475 async_assert_fn!(tokio::time::timeout(Duration, BoxFuture<()>): !Send & !Sync & !Unpin);
476 async_assert_fn!(tokio::time::timeout_at(Instant, BoxFutureSync<()>): Send & Sync & !Unpin);
477 async_assert_fn!(tokio::time::timeout_at(Instant, BoxFutureSend<()>): Send & !Sync & !Unpin);
478 async_assert_fn!(tokio::time::timeout_at(Instant, BoxFuture<()>): !Send & !Sync & !Unpin);
479 async_assert_fn!(tokio::time::Interval::tick(_): Send & Sync & !Unpin);
480 
481 assert_value!(tokio::io::BufReader<TcpStream>: Send & Sync & Unpin);
482 assert_value!(tokio::io::BufStream<TcpStream>: Send & Sync & Unpin);
483 assert_value!(tokio::io::BufWriter<TcpStream>: Send & Sync & Unpin);
484 assert_value!(tokio::io::DuplexStream: Send & Sync & Unpin);
485 assert_value!(tokio::io::Empty: Send & Sync & Unpin);
486 assert_value!(tokio::io::Interest: Send & Sync & Unpin);
487 assert_value!(tokio::io::Lines<TcpStream>: Send & Sync & Unpin);
488 assert_value!(tokio::io::ReadBuf<'_>: Send & Sync & Unpin);
489 assert_value!(tokio::io::ReadHalf<TcpStream>: Send & Sync & Unpin);
490 assert_value!(tokio::io::Ready: Send & Sync & Unpin);
491 assert_value!(tokio::io::Repeat: Send & Sync & Unpin);
492 assert_value!(tokio::io::Sink: Send & Sync & Unpin);
493 assert_value!(tokio::io::Split<TcpStream>: Send & Sync & Unpin);
494 assert_value!(tokio::io::Stderr: Send & Sync & Unpin);
495 assert_value!(tokio::io::Stdin: Send & Sync & Unpin);
496 assert_value!(tokio::io::Stdout: Send & Sync & Unpin);
497 assert_value!(tokio::io::Take<TcpStream>: Send & Sync & Unpin);
498 assert_value!(tokio::io::WriteHalf<TcpStream>: Send & Sync & Unpin);
499 async_assert_fn!(tokio::io::copy(&mut TcpStream, &mut TcpStream): Send & Sync & !Unpin);
500 async_assert_fn!(
501     tokio::io::copy_bidirectional(&mut TcpStream, &mut TcpStream): Send & Sync & !Unpin
502 );
503 async_assert_fn!(tokio::io::copy_buf(&mut tokio::io::BufReader<TcpStream>, &mut TcpStream): Send & Sync & !Unpin);
504 async_assert_fn!(tokio::io::empty(): Send & Sync & Unpin);
505 async_assert_fn!(tokio::io::repeat(u8): Send & Sync & Unpin);
506 async_assert_fn!(tokio::io::sink(): Send & Sync & Unpin);
507 async_assert_fn!(tokio::io::split(TcpStream): Send & Sync & Unpin);
508 async_assert_fn!(tokio::io::stderr(): Send & Sync & Unpin);
509 async_assert_fn!(tokio::io::stdin(): Send & Sync & Unpin);
510 async_assert_fn!(tokio::io::stdout(): Send & Sync & Unpin);
511 async_assert_fn!(tokio::io::Split<tokio::io::BufReader<TcpStream>>::next_segment(_): Send & Sync & !Unpin);
512 async_assert_fn!(tokio::io::Lines<tokio::io::BufReader<TcpStream>>::next_line(_): Send & Sync & !Unpin);
513 async_assert_fn!(tokio::io::AsyncBufReadExt::read_until(&mut BoxAsyncRead, u8, &mut Vec<u8>): Send & Sync & !Unpin);
514 async_assert_fn!(
515     tokio::io::AsyncBufReadExt::read_line(&mut BoxAsyncRead, &mut String): Send & Sync & !Unpin
516 );
517 async_assert_fn!(tokio::io::AsyncBufReadExt::fill_buf(&mut BoxAsyncRead): Send & Sync & !Unpin);
518 async_assert_fn!(tokio::io::AsyncReadExt::read(&mut BoxAsyncRead, &mut [u8]): Send & Sync & !Unpin);
519 async_assert_fn!(tokio::io::AsyncReadExt::read_buf(&mut BoxAsyncRead, &mut Vec<u8>): Send & Sync & !Unpin);
520 async_assert_fn!(
521     tokio::io::AsyncReadExt::read_exact(&mut BoxAsyncRead, &mut [u8]): Send & Sync & !Unpin
522 );
523 async_assert_fn!(tokio::io::AsyncReadExt::read_u8(&mut BoxAsyncRead): Send & Sync & !Unpin);
524 async_assert_fn!(tokio::io::AsyncReadExt::read_i8(&mut BoxAsyncRead): Send & Sync & !Unpin);
525 async_assert_fn!(tokio::io::AsyncReadExt::read_u16(&mut BoxAsyncRead): Send & Sync & !Unpin);
526 async_assert_fn!(tokio::io::AsyncReadExt::read_i16(&mut BoxAsyncRead): Send & Sync & !Unpin);
527 async_assert_fn!(tokio::io::AsyncReadExt::read_u32(&mut BoxAsyncRead): Send & Sync & !Unpin);
528 async_assert_fn!(tokio::io::AsyncReadExt::read_i32(&mut BoxAsyncRead): Send & Sync & !Unpin);
529 async_assert_fn!(tokio::io::AsyncReadExt::read_u64(&mut BoxAsyncRead): Send & Sync & !Unpin);
530 async_assert_fn!(tokio::io::AsyncReadExt::read_i64(&mut BoxAsyncRead): Send & Sync & !Unpin);
531 async_assert_fn!(tokio::io::AsyncReadExt::read_u128(&mut BoxAsyncRead): Send & Sync & !Unpin);
532 async_assert_fn!(tokio::io::AsyncReadExt::read_i128(&mut BoxAsyncRead): Send & Sync & !Unpin);
533 async_assert_fn!(tokio::io::AsyncReadExt::read_f32(&mut BoxAsyncRead): Send & Sync & !Unpin);
534 async_assert_fn!(tokio::io::AsyncReadExt::read_f64(&mut BoxAsyncRead): Send & Sync & !Unpin);
535 async_assert_fn!(tokio::io::AsyncReadExt::read_u16_le(&mut BoxAsyncRead): Send & Sync & !Unpin);
536 async_assert_fn!(tokio::io::AsyncReadExt::read_i16_le(&mut BoxAsyncRead): Send & Sync & !Unpin);
537 async_assert_fn!(tokio::io::AsyncReadExt::read_u32_le(&mut BoxAsyncRead): Send & Sync & !Unpin);
538 async_assert_fn!(tokio::io::AsyncReadExt::read_i32_le(&mut BoxAsyncRead): Send & Sync & !Unpin);
539 async_assert_fn!(tokio::io::AsyncReadExt::read_u64_le(&mut BoxAsyncRead): Send & Sync & !Unpin);
540 async_assert_fn!(tokio::io::AsyncReadExt::read_i64_le(&mut BoxAsyncRead): Send & Sync & !Unpin);
541 async_assert_fn!(tokio::io::AsyncReadExt::read_u128_le(&mut BoxAsyncRead): Send & Sync & !Unpin);
542 async_assert_fn!(tokio::io::AsyncReadExt::read_i128_le(&mut BoxAsyncRead): Send & Sync & !Unpin);
543 async_assert_fn!(tokio::io::AsyncReadExt::read_f32_le(&mut BoxAsyncRead): Send & Sync & !Unpin);
544 async_assert_fn!(tokio::io::AsyncReadExt::read_f64_le(&mut BoxAsyncRead): Send & Sync & !Unpin);
545 async_assert_fn!(tokio::io::AsyncReadExt::read_to_end(&mut BoxAsyncRead, &mut Vec<u8>): Send & Sync & !Unpin);
546 async_assert_fn!(
547     tokio::io::AsyncReadExt::read_to_string(&mut BoxAsyncRead, &mut String): Send & Sync & !Unpin
548 );
549 async_assert_fn!(tokio::io::AsyncSeekExt::seek(&mut BoxAsyncSeek, SeekFrom): Send & Sync & !Unpin);
550 async_assert_fn!(tokio::io::AsyncSeekExt::stream_position(&mut BoxAsyncSeek): Send & Sync & !Unpin);
551 async_assert_fn!(tokio::io::AsyncWriteExt::write(&mut BoxAsyncWrite, &[u8]): Send & Sync & !Unpin);
552 async_assert_fn!(
553     tokio::io::AsyncWriteExt::write_vectored(&mut BoxAsyncWrite, _): Send & Sync & !Unpin
554 );
555 async_assert_fn!(
556     tokio::io::AsyncWriteExt::write_buf(&mut BoxAsyncWrite, &mut bytes::Bytes): Send
557         & Sync
558         & !Unpin
559 );
560 async_assert_fn!(
561     tokio::io::AsyncWriteExt::write_all_buf(&mut BoxAsyncWrite, &mut bytes::Bytes): Send
562         & Sync
563         & !Unpin
564 );
565 async_assert_fn!(
566     tokio::io::AsyncWriteExt::write_all(&mut BoxAsyncWrite, &[u8]): Send & Sync & !Unpin
567 );
568 async_assert_fn!(tokio::io::AsyncWriteExt::write_u8(&mut BoxAsyncWrite, u8): Send & Sync & !Unpin);
569 async_assert_fn!(tokio::io::AsyncWriteExt::write_i8(&mut BoxAsyncWrite, i8): Send & Sync & !Unpin);
570 async_assert_fn!(
571     tokio::io::AsyncWriteExt::write_u16(&mut BoxAsyncWrite, u16): Send & Sync & !Unpin
572 );
573 async_assert_fn!(
574     tokio::io::AsyncWriteExt::write_i16(&mut BoxAsyncWrite, i16): Send & Sync & !Unpin
575 );
576 async_assert_fn!(
577     tokio::io::AsyncWriteExt::write_u32(&mut BoxAsyncWrite, u32): Send & Sync & !Unpin
578 );
579 async_assert_fn!(
580     tokio::io::AsyncWriteExt::write_i32(&mut BoxAsyncWrite, i32): Send & Sync & !Unpin
581 );
582 async_assert_fn!(
583     tokio::io::AsyncWriteExt::write_u64(&mut BoxAsyncWrite, u64): Send & Sync & !Unpin
584 );
585 async_assert_fn!(
586     tokio::io::AsyncWriteExt::write_i64(&mut BoxAsyncWrite, i64): Send & Sync & !Unpin
587 );
588 async_assert_fn!(
589     tokio::io::AsyncWriteExt::write_u128(&mut BoxAsyncWrite, u128): Send & Sync & !Unpin
590 );
591 async_assert_fn!(
592     tokio::io::AsyncWriteExt::write_i128(&mut BoxAsyncWrite, i128): Send & Sync & !Unpin
593 );
594 async_assert_fn!(
595     tokio::io::AsyncWriteExt::write_f32(&mut BoxAsyncWrite, f32): Send & Sync & !Unpin
596 );
597 async_assert_fn!(
598     tokio::io::AsyncWriteExt::write_f64(&mut BoxAsyncWrite, f64): Send & Sync & !Unpin
599 );
600 async_assert_fn!(
601     tokio::io::AsyncWriteExt::write_u16_le(&mut BoxAsyncWrite, u16): Send & Sync & !Unpin
602 );
603 async_assert_fn!(
604     tokio::io::AsyncWriteExt::write_i16_le(&mut BoxAsyncWrite, i16): Send & Sync & !Unpin
605 );
606 async_assert_fn!(
607     tokio::io::AsyncWriteExt::write_u32_le(&mut BoxAsyncWrite, u32): Send & Sync & !Unpin
608 );
609 async_assert_fn!(
610     tokio::io::AsyncWriteExt::write_i32_le(&mut BoxAsyncWrite, i32): Send & Sync & !Unpin
611 );
612 async_assert_fn!(
613     tokio::io::AsyncWriteExt::write_u64_le(&mut BoxAsyncWrite, u64): Send & Sync & !Unpin
614 );
615 async_assert_fn!(
616     tokio::io::AsyncWriteExt::write_i64_le(&mut BoxAsyncWrite, i64): Send & Sync & !Unpin
617 );
618 async_assert_fn!(
619     tokio::io::AsyncWriteExt::write_u128_le(&mut BoxAsyncWrite, u128): Send & Sync & !Unpin
620 );
621 async_assert_fn!(
622     tokio::io::AsyncWriteExt::write_i128_le(&mut BoxAsyncWrite, i128): Send & Sync & !Unpin
623 );
624 async_assert_fn!(
625     tokio::io::AsyncWriteExt::write_f32_le(&mut BoxAsyncWrite, f32): Send & Sync & !Unpin
626 );
627 async_assert_fn!(
628     tokio::io::AsyncWriteExt::write_f64_le(&mut BoxAsyncWrite, f64): Send & Sync & !Unpin
629 );
630 async_assert_fn!(tokio::io::AsyncWriteExt::flush(&mut BoxAsyncWrite): Send & Sync & !Unpin);
631 async_assert_fn!(tokio::io::AsyncWriteExt::shutdown(&mut BoxAsyncWrite): Send & Sync & !Unpin);
632 
633 #[cfg(unix)]
634 mod unix_asyncfd {
635     use super::*;
636     use tokio::io::unix::*;
637 
638     struct ImplsFd<T> {
639         _t: T,
640     }
641     impl<T> std::os::unix::io::AsRawFd for ImplsFd<T> {
as_raw_fd(&self) -> std::os::unix::io::RawFd642         fn as_raw_fd(&self) -> std::os::unix::io::RawFd {
643             unreachable!()
644         }
645     }
646 
647     assert_value!(AsyncFd<ImplsFd<YY>>: Send & Sync & Unpin);
648     assert_value!(AsyncFd<ImplsFd<YN>>: Send & !Sync & Unpin);
649     assert_value!(AsyncFd<ImplsFd<NN>>: !Send & !Sync & Unpin);
650     assert_value!(AsyncFdReadyGuard<'_, ImplsFd<YY>>: Send & Sync & Unpin);
651     assert_value!(AsyncFdReadyGuard<'_, ImplsFd<YN>>: !Send & !Sync & Unpin);
652     assert_value!(AsyncFdReadyGuard<'_, ImplsFd<NN>>: !Send & !Sync & Unpin);
653     assert_value!(AsyncFdReadyMutGuard<'_, ImplsFd<YY>>: Send & Sync & Unpin);
654     assert_value!(AsyncFdReadyMutGuard<'_, ImplsFd<YN>>: Send & !Sync & Unpin);
655     assert_value!(AsyncFdReadyMutGuard<'_, ImplsFd<NN>>: !Send & !Sync & Unpin);
656     assert_value!(TryIoError: Send & Sync & Unpin);
657     async_assert_fn!(AsyncFd<ImplsFd<YY>>::readable(_): Send & Sync & !Unpin);
658     async_assert_fn!(AsyncFd<ImplsFd<YY>>::readable_mut(_): Send & Sync & !Unpin);
659     async_assert_fn!(AsyncFd<ImplsFd<YY>>::writable(_): Send & Sync & !Unpin);
660     async_assert_fn!(AsyncFd<ImplsFd<YY>>::writable_mut(_): Send & Sync & !Unpin);
661     async_assert_fn!(AsyncFd<ImplsFd<YN>>::readable(_): !Send & !Sync & !Unpin);
662     async_assert_fn!(AsyncFd<ImplsFd<YN>>::readable_mut(_): Send & !Sync & !Unpin);
663     async_assert_fn!(AsyncFd<ImplsFd<YN>>::writable(_): !Send & !Sync & !Unpin);
664     async_assert_fn!(AsyncFd<ImplsFd<YN>>::writable_mut(_): Send & !Sync & !Unpin);
665     async_assert_fn!(AsyncFd<ImplsFd<NN>>::readable(_): !Send & !Sync & !Unpin);
666     async_assert_fn!(AsyncFd<ImplsFd<NN>>::readable_mut(_): !Send & !Sync & !Unpin);
667     async_assert_fn!(AsyncFd<ImplsFd<NN>>::writable(_): !Send & !Sync & !Unpin);
668     async_assert_fn!(AsyncFd<ImplsFd<NN>>::writable_mut(_): !Send & !Sync & !Unpin);
669 }
670