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