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