1#![warn(rust_2018_idioms)]
2#![cfg(feature = "full")]
3#![allow(clippy::type_complexity, clippy::diverging_sub_expression)]
4
5use std::cell::Cell;
6use std::future::Future;
7use std::io::SeekFrom;
8use std::net::SocketAddr;
9use std::pin::Pin;
10use std::rc::Rc;
11use tokio::net::TcpStream;
12use tokio::time::{Duration, Instant};
13
14// The names of these structs behaves better when sorted.
15// Send: Yes, Sync: Yes
16#[derive(Clone)]
17struct YY {}
18
19// Send: Yes, Sync: No
20#[derive(Clone)]
21struct YN {
22 _value: Cell<u8>,
23}
24
25// Send: No, Sync: No
26#[derive(Clone)]
27struct NN {
28 _value: Rc<u8>,
29}
30
31#[allow(dead_code)]
32type BoxFutureSync<T> = std::pin::Pin<Box<dyn std::future::Future<Output = T> + Send + Sync>>;
33#[allow(dead_code)]
34type BoxFutureSend<T> = std::pin::Pin<Box<dyn std::future::Future<Output = T> + Send>>;
35#[allow(dead_code)]
36type BoxFuture<T> = std::pin::Pin<Box<dyn std::future::Future<Output = T>>>;
37
38#[allow(dead_code)]
39type BoxAsyncRead = std::pin::Pin<Box<dyn tokio::io::AsyncBufRead + Send + Sync>>;
40#[allow(dead_code)]
41type BoxAsyncSeek = std::pin::Pin<Box<dyn tokio::io::AsyncSeek + Send + Sync>>;
42#[allow(dead_code)]
43type BoxAsyncWrite = std::pin::Pin<Box<dyn tokio::io::AsyncWrite + Send + Sync>>;
44
45#[allow(dead_code)]
46fn require_send<T: Send>(_t: &T) {}
47#[allow(dead_code)]
48fn require_sync<T: Sync>(_t: &T) {}
49#[allow(dead_code)]
50fn require_unpin<T: Unpin>(_t: &T) {}
51
52#[allow(dead_code)]
53struct Invalid;
54
55trait AmbiguousIfSend<A> {
56 fn some_item(&self) {}
57}
58impl<T: ?Sized> AmbiguousIfSend<()> for T {}
59impl<T: ?Sized + Send> AmbiguousIfSend<Invalid> for T {}
60
61trait AmbiguousIfSync<A> {
62 fn some_item(&self) {}
63}
64impl<T: ?Sized> AmbiguousIfSync<()> for T {}
65impl<T: ?Sized + Sync> AmbiguousIfSync<Invalid> for T {}
66
67trait AmbiguousIfUnpin<A> {
68 fn some_item(&self) {}
69}
70impl<T: ?Sized> AmbiguousIfUnpin<()> for T {}
71impl<T: ?Sized + Unpin> AmbiguousIfUnpin<Invalid> for T {}
72
73macro_rules! into_todo {
74 ($typ:ty) => {{
75 let x: $typ = todo!();
76 x
77 }};
78}
79
80macro_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}
88macro_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}
96macro_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
105macro_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}
117macro_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
130macro_rules! cfg_not_wasi {
131 ($($item:item)*) => {
132 $(
133 #[cfg(not(target_os = "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.
142const _: 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
154cfg_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
199cfg_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
205assert_value!(tokio::net::TcpListener: Send & Sync & Unpin);
206assert_value!(tokio::net::TcpStream: Send & Sync & Unpin);
207assert_value!(tokio::net::tcp::OwnedReadHalf: Send & Sync & Unpin);
208assert_value!(tokio::net::tcp::OwnedWriteHalf: Send & Sync & Unpin);
209assert_value!(tokio::net::tcp::ReadHalf<'_>: Send & Sync & Unpin);
210assert_value!(tokio::net::tcp::ReuniteError: Send & Sync & Unpin);
211assert_value!(tokio::net::tcp::WriteHalf<'_>: Send & Sync & Unpin);
212async_assert_fn!(tokio::net::TcpListener::accept(_): Send & Sync & !Unpin);
213async_assert_fn!(tokio::net::TcpStream::peek(_, &mut [u8]): Send & Sync & !Unpin);
214async_assert_fn!(tokio::net::TcpStream::readable(_): Send & Sync & !Unpin);
215async_assert_fn!(tokio::net::TcpStream::ready(_, tokio::io::Interest): Send & Sync & !Unpin);
216async_assert_fn!(tokio::net::TcpStream::writable(_): Send & Sync & !Unpin);
217
218// Wasi does not support UDP
219cfg_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}
235async_assert_fn!(tokio::net::lookup_host(SocketAddr): Send & Sync & !Unpin);
236async_assert_fn!(tokio::net::tcp::ReadHalf::peek(_, &mut [u8]): Send & Sync & !Unpin);
237
238#[cfg(unix)]
239mod 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(unix)]
267mod unix_pipe {
268 use super::*;
269 use tokio::net::unix::pipe::*;
270 assert_value!(OpenOptions: Send & Sync & Unpin);
271 assert_value!(Receiver: Send & Sync & Unpin);
272 assert_value!(Sender: Send & Sync & Unpin);
273 async_assert_fn!(Receiver::readable(_): Send & Sync & !Unpin);
274 async_assert_fn!(Receiver::ready(_, tokio::io::Interest): Send & Sync & !Unpin);
275 async_assert_fn!(Sender::ready(_, tokio::io::Interest): Send & Sync & !Unpin);
276 async_assert_fn!(Sender::writable(_): Send & Sync & !Unpin);
277}
278
279#[cfg(windows)]
280mod windows_named_pipe {
281 use super::*;
282 use tokio::net::windows::named_pipe::*;
283 assert_value!(ClientOptions: Send & Sync & Unpin);
284 assert_value!(NamedPipeClient: Send & Sync & Unpin);
285 assert_value!(NamedPipeServer: Send & Sync & Unpin);
286 assert_value!(PipeEnd: Send & Sync & Unpin);
287 assert_value!(PipeInfo: Send & Sync & Unpin);
288 assert_value!(PipeMode: Send & Sync & Unpin);
289 assert_value!(ServerOptions: Send & Sync & Unpin);
290 async_assert_fn!(NamedPipeClient::readable(_): Send & Sync & !Unpin);
291 async_assert_fn!(NamedPipeClient::ready(_, tokio::io::Interest): Send & Sync & !Unpin);
292 async_assert_fn!(NamedPipeClient::writable(_): Send & Sync & !Unpin);
293 async_assert_fn!(NamedPipeServer::connect(_): Send & Sync & !Unpin);
294 async_assert_fn!(NamedPipeServer::readable(_): Send & Sync & !Unpin);
295 async_assert_fn!(NamedPipeServer::ready(_, tokio::io::Interest): Send & Sync & !Unpin);
296 async_assert_fn!(NamedPipeServer::writable(_): Send & Sync & !Unpin);
297}
298
299cfg_not_wasi! {
300 mod test_process {
301 use super::*;
302 assert_value!(tokio::process::Child: Send & Sync & Unpin);
303 assert_value!(tokio::process::ChildStderr: Send & Sync & Unpin);
304 assert_value!(tokio::process::ChildStdin: Send & Sync & Unpin);
305 assert_value!(tokio::process::ChildStdout: Send & Sync & Unpin);
306 assert_value!(tokio::process::Command: Send & Sync & Unpin);
307 async_assert_fn!(tokio::process::Child::kill(_): Send & Sync & !Unpin);
308 async_assert_fn!(tokio::process::Child::wait(_): Send & Sync & !Unpin);
309 async_assert_fn!(tokio::process::Child::wait_with_output(_): Send & Sync & !Unpin);
310 }
311
312 async_assert_fn!(tokio::signal::ctrl_c(): Send & Sync & !Unpin);
313}
314
315#[cfg(unix)]
316mod unix_signal {
317 use super::*;
318 assert_value!(tokio::signal::unix::Signal: Send & Sync & Unpin);
319 assert_value!(tokio::signal::unix::SignalKind: Send & Sync & Unpin);
320 async_assert_fn!(tokio::signal::unix::Signal::recv(_): Send & Sync & !Unpin);
321}
322#[cfg(windows)]
323mod windows_signal {
324 use super::*;
325 assert_value!(tokio::signal::windows::CtrlC: Send & Sync & Unpin);
326 assert_value!(tokio::signal::windows::CtrlBreak: Send & Sync & Unpin);
327 async_assert_fn!(tokio::signal::windows::CtrlC::recv(_): Send & Sync & !Unpin);
328 async_assert_fn!(tokio::signal::windows::CtrlBreak::recv(_): Send & Sync & !Unpin);
329}
330
331assert_value!(tokio::sync::AcquireError: Send & Sync & Unpin);
332assert_value!(tokio::sync::Barrier: Send & Sync & Unpin);
333assert_value!(tokio::sync::BarrierWaitResult: Send & Sync & Unpin);
334assert_value!(tokio::sync::MappedMutexGuard<'_, NN>: !Send & !Sync & Unpin);
335assert_value!(tokio::sync::MappedMutexGuard<'_, YN>: Send & !Sync & Unpin);
336assert_value!(tokio::sync::MappedMutexGuard<'_, YY>: Send & Sync & Unpin);
337assert_value!(tokio::sync::Mutex<NN>: !Send & !Sync & Unpin);
338assert_value!(tokio::sync::Mutex<YN>: Send & Sync & Unpin);
339assert_value!(tokio::sync::Mutex<YY>: Send & Sync & Unpin);
340assert_value!(tokio::sync::MutexGuard<'_, NN>: !Send & !Sync & Unpin);
341assert_value!(tokio::sync::MutexGuard<'_, YN>: Send & !Sync & Unpin);
342assert_value!(tokio::sync::MutexGuard<'_, YY>: Send & Sync & Unpin);
343assert_value!(tokio::sync::Notify: Send & Sync & Unpin);
344assert_value!(tokio::sync::OnceCell<NN>: !Send & !Sync & Unpin);
345assert_value!(tokio::sync::OnceCell<YN>: Send & !Sync & Unpin);
346assert_value!(tokio::sync::OnceCell<YY>: Send & Sync & Unpin);
347assert_value!(tokio::sync::OwnedMutexGuard<NN>: !Send & !Sync & Unpin);
348assert_value!(tokio::sync::OwnedMutexGuard<YN>: Send & !Sync & Unpin);
349assert_value!(tokio::sync::OwnedMutexGuard<YY>: Send & Sync & Unpin);
350assert_value!(tokio::sync::OwnedMappedMutexGuard<NN,NN>: !Send & !Sync & Unpin);
351assert_value!(tokio::sync::OwnedMappedMutexGuard<NN,YN>: !Send & !Sync & Unpin);
352assert_value!(tokio::sync::OwnedMappedMutexGuard<NN,YY>: !Send & !Sync & Unpin);
353assert_value!(tokio::sync::OwnedMappedMutexGuard<YN,NN>: !Send & !Sync & Unpin);
354assert_value!(tokio::sync::OwnedMappedMutexGuard<YN,YN>: Send & !Sync & Unpin);
355assert_value!(tokio::sync::OwnedMappedMutexGuard<YN,YY>: Send & !Sync & Unpin);
356assert_value!(tokio::sync::OwnedMappedMutexGuard<YY,NN>: !Send & !Sync & Unpin);
357assert_value!(tokio::sync::OwnedMappedMutexGuard<YY,YN>: Send & !Sync & Unpin);
358assert_value!(tokio::sync::OwnedMappedMutexGuard<YY,YY>: Send & Sync & Unpin);
359assert_value!(tokio::sync::OwnedRwLockMappedWriteGuard<NN>: !Send & !Sync & Unpin);
360assert_value!(tokio::sync::OwnedRwLockMappedWriteGuard<YN>: !Send & !Sync & Unpin);
361assert_value!(tokio::sync::OwnedRwLockMappedWriteGuard<YY>: Send & Sync & Unpin);
362assert_value!(tokio::sync::OwnedRwLockReadGuard<NN>: !Send & !Sync & Unpin);
363assert_value!(tokio::sync::OwnedRwLockReadGuard<YN>: !Send & !Sync & Unpin);
364assert_value!(tokio::sync::OwnedRwLockReadGuard<YY>: Send & Sync & Unpin);
365assert_value!(tokio::sync::OwnedRwLockWriteGuard<NN>: !Send & !Sync & Unpin);
366assert_value!(tokio::sync::OwnedRwLockWriteGuard<YN>: !Send & !Sync & Unpin);
367assert_value!(tokio::sync::OwnedRwLockWriteGuard<YY>: Send & Sync & Unpin);
368assert_value!(tokio::sync::OwnedSemaphorePermit: Send & Sync & Unpin);
369assert_value!(tokio::sync::RwLock<NN>: !Send & !Sync & Unpin);
370assert_value!(tokio::sync::RwLock<YN>: Send & !Sync & Unpin);
371assert_value!(tokio::sync::RwLock<YY>: Send & Sync & Unpin);
372assert_value!(tokio::sync::RwLockMappedWriteGuard<'_, NN>: !Send & !Sync & Unpin);
373assert_value!(tokio::sync::RwLockMappedWriteGuard<'_, YN>: !Send & !Sync & Unpin);
374assert_value!(tokio::sync::RwLockMappedWriteGuard<'_, YY>: Send & Sync & Unpin);
375assert_value!(tokio::sync::RwLockReadGuard<'_, NN>: !Send & !Sync & Unpin);
376assert_value!(tokio::sync::RwLockReadGuard<'_, YN>: !Send & !Sync & Unpin);
377assert_value!(tokio::sync::RwLockReadGuard<'_, YY>: Send & Sync & Unpin);
378assert_value!(tokio::sync::RwLockWriteGuard<'_, NN>: !Send & !Sync & Unpin);
379assert_value!(tokio::sync::RwLockWriteGuard<'_, YN>: !Send & !Sync & Unpin);
380assert_value!(tokio::sync::RwLockWriteGuard<'_, YY>: Send & Sync & Unpin);
381assert_value!(tokio::sync::Semaphore: Send & Sync & Unpin);
382assert_value!(tokio::sync::SemaphorePermit<'_>: Send & Sync & Unpin);
383assert_value!(tokio::sync::TryAcquireError: Send & Sync & Unpin);
384assert_value!(tokio::sync::TryLockError: Send & Sync & Unpin);
385assert_value!(tokio::sync::broadcast::Receiver<NN>: !Send & !Sync & Unpin);
386assert_value!(tokio::sync::broadcast::Receiver<YN>: Send & Sync & Unpin);
387assert_value!(tokio::sync::broadcast::Receiver<YY>: Send & Sync & Unpin);
388assert_value!(tokio::sync::broadcast::Sender<NN>: !Send & !Sync & Unpin);
389assert_value!(tokio::sync::broadcast::Sender<YN>: Send & Sync & Unpin);
390assert_value!(tokio::sync::broadcast::Sender<YY>: Send & Sync & Unpin);
391assert_value!(tokio::sync::futures::Notified<'_>: Send & Sync & !Unpin);
392assert_value!(tokio::sync::mpsc::OwnedPermit<NN>: !Send & !Sync & Unpin);
393assert_value!(tokio::sync::mpsc::OwnedPermit<YN>: Send & Sync & Unpin);
394assert_value!(tokio::sync::mpsc::OwnedPermit<YY>: Send & Sync & Unpin);
395assert_value!(tokio::sync::mpsc::Permit<'_, NN>: !Send & !Sync & Unpin);
396assert_value!(tokio::sync::mpsc::Permit<'_, YN>: Send & Sync & Unpin);
397assert_value!(tokio::sync::mpsc::Permit<'_, YY>: Send & Sync & Unpin);
398assert_value!(tokio::sync::mpsc::Receiver<NN>: !Send & !Sync & Unpin);
399assert_value!(tokio::sync::mpsc::Receiver<YN>: Send & Sync & Unpin);
400assert_value!(tokio::sync::mpsc::Receiver<YY>: Send & Sync & Unpin);
401assert_value!(tokio::sync::mpsc::Sender<NN>: !Send & !Sync & Unpin);
402assert_value!(tokio::sync::mpsc::Sender<YN>: Send & Sync & Unpin);
403assert_value!(tokio::sync::mpsc::Sender<YY>: Send & Sync & Unpin);
404assert_value!(tokio::sync::mpsc::UnboundedReceiver<NN>: !Send & !Sync & Unpin);
405assert_value!(tokio::sync::mpsc::UnboundedReceiver<YN>: Send & Sync & Unpin);
406assert_value!(tokio::sync::mpsc::UnboundedReceiver<YY>: Send & Sync & Unpin);
407assert_value!(tokio::sync::mpsc::UnboundedSender<NN>: !Send & !Sync & Unpin);
408assert_value!(tokio::sync::mpsc::UnboundedSender<YN>: Send & Sync & Unpin);
409assert_value!(tokio::sync::mpsc::UnboundedSender<YY>: Send & Sync & Unpin);
410assert_value!(tokio::sync::mpsc::error::SendError<NN>: !Send & !Sync & Unpin);
411assert_value!(tokio::sync::mpsc::error::SendError<YN>: Send & !Sync & Unpin);
412assert_value!(tokio::sync::mpsc::error::SendError<YY>: Send & Sync & Unpin);
413assert_value!(tokio::sync::mpsc::error::SendTimeoutError<NN>: !Send & !Sync & Unpin);
414assert_value!(tokio::sync::mpsc::error::SendTimeoutError<YN>: Send & !Sync & Unpin);
415assert_value!(tokio::sync::mpsc::error::SendTimeoutError<YY>: Send & Sync & Unpin);
416assert_value!(tokio::sync::mpsc::error::TrySendError<NN>: !Send & !Sync & Unpin);
417assert_value!(tokio::sync::mpsc::error::TrySendError<YN>: Send & !Sync & Unpin);
418assert_value!(tokio::sync::mpsc::error::TrySendError<YY>: Send & Sync & Unpin);
419assert_value!(tokio::sync::oneshot::Receiver<NN>: !Send & !Sync & Unpin);
420assert_value!(tokio::sync::oneshot::Receiver<YN>: Send & Sync & Unpin);
421assert_value!(tokio::sync::oneshot::Receiver<YY>: Send & Sync & Unpin);
422assert_value!(tokio::sync::oneshot::Sender<NN>: !Send & !Sync & Unpin);
423assert_value!(tokio::sync::oneshot::Sender<YN>: Send & Sync & Unpin);
424assert_value!(tokio::sync::oneshot::Sender<YY>: Send & Sync & Unpin);
425assert_value!(tokio::sync::watch::Receiver<NN>: !Send & !Sync & Unpin);
426assert_value!(tokio::sync::watch::Receiver<YN>: !Send & !Sync & Unpin);
427assert_value!(tokio::sync::watch::Receiver<YY>: Send & Sync & Unpin);
428assert_value!(tokio::sync::watch::Ref<'_, NN>: !Send & !Sync & Unpin);
429assert_value!(tokio::sync::watch::Ref<'_, YN>: !Send & !Sync & Unpin);
430assert_value!(tokio::sync::watch::Ref<'_, YY>: !Send & Sync & Unpin);
431assert_value!(tokio::sync::watch::Sender<NN>: !Send & !Sync & Unpin);
432assert_value!(tokio::sync::watch::Sender<YN>: !Send & !Sync & Unpin);
433assert_value!(tokio::sync::watch::Sender<YY>: Send & Sync & Unpin);
434assert_value!(tokio::task::JoinError: Send & Sync & Unpin);
435assert_value!(tokio::task::JoinHandle<NN>: !Send & !Sync & Unpin);
436assert_value!(tokio::task::JoinHandle<YN>: Send & Sync & Unpin);
437assert_value!(tokio::task::JoinHandle<YY>: Send & Sync & Unpin);
438assert_value!(tokio::task::JoinSet<NN>: !Send & !Sync & Unpin);
439assert_value!(tokio::task::JoinSet<YN>: Send & Sync & Unpin);
440assert_value!(tokio::task::JoinSet<YY>: Send & Sync & Unpin);
441assert_value!(tokio::task::LocalSet: !Send & !Sync & Unpin);
442async_assert_fn!(tokio::sync::Barrier::wait(_): Send & Sync & !Unpin);
443async_assert_fn!(tokio::sync::Mutex<NN>::lock(_): !Send & !Sync & !Unpin);
444async_assert_fn!(tokio::sync::Mutex<NN>::lock_owned(_): !Send & !Sync & !Unpin);
445async_assert_fn!(tokio::sync::Mutex<YN>::lock(_): Send & Sync & !Unpin);
446async_assert_fn!(tokio::sync::Mutex<YN>::lock_owned(_): Send & Sync & !Unpin);
447async_assert_fn!(tokio::sync::Mutex<YY>::lock(_): Send & Sync & !Unpin);
448async_assert_fn!(tokio::sync::Mutex<YY>::lock_owned(_): Send & Sync & !Unpin);
449async_assert_fn!(tokio::sync::Notify::notified(_): Send & Sync & !Unpin);
450async_assert_fn!(tokio::sync::OnceCell<NN>::get_or_init( _, fn() -> Pin<Box<dyn Future<Output = NN> + Send + Sync>>): !Send & !Sync & !Unpin);
451async_assert_fn!(tokio::sync::OnceCell<NN>::get_or_init( _, fn() -> Pin<Box<dyn Future<Output = NN> + Send>>): !Send & !Sync & !Unpin);
452async_assert_fn!(tokio::sync::OnceCell<NN>::get_or_init( _, fn() -> Pin<Box<dyn Future<Output = NN>>>): !Send & !Sync & !Unpin);
453async_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);
454async_assert_fn!(tokio::sync::OnceCell<NN>::get_or_try_init( _, fn() -> Pin<Box<dyn Future<Output = std::io::Result<NN>> + Send>>): !Send & !Sync & !Unpin);
455async_assert_fn!(tokio::sync::OnceCell<NN>::get_or_try_init( _, fn() -> Pin<Box<dyn Future<Output = std::io::Result<NN>>>>): !Send & !Sync & !Unpin);
456async_assert_fn!(tokio::sync::OnceCell<YN>::get_or_init( _, fn() -> Pin<Box<dyn Future<Output = YN> + Send + Sync>>): !Send & !Sync & !Unpin);
457async_assert_fn!(tokio::sync::OnceCell<YN>::get_or_init( _, fn() -> Pin<Box<dyn Future<Output = YN> + Send>>): !Send & !Sync & !Unpin);
458async_assert_fn!(tokio::sync::OnceCell<YN>::get_or_init( _, fn() -> Pin<Box<dyn Future<Output = YN>>>): !Send & !Sync & !Unpin);
459async_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);
460async_assert_fn!(tokio::sync::OnceCell<YN>::get_or_try_init( _, fn() -> Pin<Box<dyn Future<Output = std::io::Result<YN>> + Send>>): !Send & !Sync & !Unpin);
461async_assert_fn!(tokio::sync::OnceCell<YN>::get_or_try_init( _, fn() -> Pin<Box<dyn Future<Output = std::io::Result<YN>>>>): !Send & !Sync & !Unpin);
462async_assert_fn!(tokio::sync::OnceCell<YY>::get_or_init( _, fn() -> Pin<Box<dyn Future<Output = YY> + Send + Sync>>): Send & Sync & !Unpin);
463async_assert_fn!(tokio::sync::OnceCell<YY>::get_or_init( _, fn() -> Pin<Box<dyn Future<Output = YY> + Send>>): Send & !Sync & !Unpin);
464async_assert_fn!(tokio::sync::OnceCell<YY>::get_or_init( _, fn() -> Pin<Box<dyn Future<Output = YY>>>): !Send & !Sync & !Unpin);
465async_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);
466async_assert_fn!(tokio::sync::OnceCell<YY>::get_or_try_init( _, fn() -> Pin<Box<dyn Future<Output = std::io::Result<YY>> + Send>>): Send & !Sync & !Unpin);
467async_assert_fn!(tokio::sync::OnceCell<YY>::get_or_try_init( _, fn() -> Pin<Box<dyn Future<Output = std::io::Result<YY>>>>): !Send & !Sync & !Unpin);
468async_assert_fn!(tokio::sync::RwLock<NN>::read(_): !Send & !Sync & !Unpin);
469async_assert_fn!(tokio::sync::RwLock<NN>::write(_): !Send & !Sync & !Unpin);
470async_assert_fn!(tokio::sync::RwLock<YN>::read(_): !Send & !Sync & !Unpin);
471async_assert_fn!(tokio::sync::RwLock<YN>::write(_): !Send & !Sync & !Unpin);
472async_assert_fn!(tokio::sync::RwLock<YY>::read(_): Send & Sync & !Unpin);
473async_assert_fn!(tokio::sync::RwLock<YY>::write(_): Send & Sync & !Unpin);
474async_assert_fn!(tokio::sync::Semaphore::acquire(_): Send & Sync & !Unpin);
475async_assert_fn!(tokio::sync::Semaphore::acquire_many(_, u32): Send & Sync & !Unpin);
476async_assert_fn!(tokio::sync::Semaphore::acquire_many_owned(_, u32): Send & Sync & !Unpin);
477async_assert_fn!(tokio::sync::Semaphore::acquire_owned(_): Send & Sync & !Unpin);
478async_assert_fn!(tokio::sync::broadcast::Receiver<NN>::recv(_): !Send & !Sync & !Unpin);
479async_assert_fn!(tokio::sync::broadcast::Receiver<YN>::recv(_): Send & Sync & !Unpin);
480async_assert_fn!(tokio::sync::broadcast::Receiver<YY>::recv(_): Send & Sync & !Unpin);
481async_assert_fn!(tokio::sync::mpsc::Receiver<NN>::recv(_): !Send & !Sync & !Unpin);
482async_assert_fn!(tokio::sync::mpsc::Receiver<YN>::recv(_): Send & Sync & !Unpin);
483async_assert_fn!(tokio::sync::mpsc::Receiver<YY>::recv(_): Send & Sync & !Unpin);
484async_assert_fn!(tokio::sync::mpsc::Sender<NN>::closed(_): !Send & !Sync & !Unpin);
485async_assert_fn!(tokio::sync::mpsc::Sender<NN>::reserve(_): !Send & !Sync & !Unpin);
486async_assert_fn!(tokio::sync::mpsc::Sender<NN>::reserve_owned(_): !Send & !Sync & !Unpin);
487async_assert_fn!(tokio::sync::mpsc::Sender<NN>::send(_, NN): !Send & !Sync & !Unpin);
488async_assert_fn!(tokio::sync::mpsc::Sender<NN>::send_timeout(_, NN, Duration): !Send & !Sync & !Unpin);
489async_assert_fn!(tokio::sync::mpsc::Sender<YN>::closed(_): Send & Sync & !Unpin);
490async_assert_fn!(tokio::sync::mpsc::Sender<YN>::reserve(_): Send & Sync & !Unpin);
491async_assert_fn!(tokio::sync::mpsc::Sender<YN>::reserve_owned(_): Send & Sync & !Unpin);
492async_assert_fn!(tokio::sync::mpsc::Sender<YN>::send(_, YN): Send & !Sync & !Unpin);
493async_assert_fn!(tokio::sync::mpsc::Sender<YN>::send_timeout(_, YN, Duration): Send & !Sync & !Unpin);
494async_assert_fn!(tokio::sync::mpsc::Sender<YY>::closed(_): Send & Sync & !Unpin);
495async_assert_fn!(tokio::sync::mpsc::Sender<YY>::reserve(_): Send & Sync & !Unpin);
496async_assert_fn!(tokio::sync::mpsc::Sender<YY>::reserve_owned(_): Send & Sync & !Unpin);
497async_assert_fn!(tokio::sync::mpsc::Sender<YY>::send(_, YY): Send & Sync & !Unpin);
498async_assert_fn!(tokio::sync::mpsc::Sender<YY>::send_timeout(_, YY, Duration): Send & Sync & !Unpin);
499async_assert_fn!(tokio::sync::mpsc::UnboundedReceiver<NN>::recv(_): !Send & !Sync & !Unpin);
500async_assert_fn!(tokio::sync::mpsc::UnboundedReceiver<YN>::recv(_): Send & Sync & !Unpin);
501async_assert_fn!(tokio::sync::mpsc::UnboundedReceiver<YY>::recv(_): Send & Sync & !Unpin);
502async_assert_fn!(tokio::sync::mpsc::UnboundedSender<NN>::closed(_): !Send & !Sync & !Unpin);
503async_assert_fn!(tokio::sync::mpsc::UnboundedSender<YN>::closed(_): Send & Sync & !Unpin);
504async_assert_fn!(tokio::sync::mpsc::UnboundedSender<YY>::closed(_): Send & Sync & !Unpin);
505async_assert_fn!(tokio::sync::oneshot::Sender<NN>::closed(_): !Send & !Sync & !Unpin);
506async_assert_fn!(tokio::sync::oneshot::Sender<YN>::closed(_): Send & Sync & !Unpin);
507async_assert_fn!(tokio::sync::oneshot::Sender<YY>::closed(_): Send & Sync & !Unpin);
508async_assert_fn!(tokio::sync::watch::Receiver<NN>::changed(_): !Send & !Sync & !Unpin);
509async_assert_fn!(tokio::sync::watch::Receiver<YN>::changed(_): !Send & !Sync & !Unpin);
510async_assert_fn!(tokio::sync::watch::Receiver<YY>::changed(_): Send & Sync & !Unpin);
511async_assert_fn!(tokio::sync::watch::Sender<NN>::closed(_): !Send & !Sync & !Unpin);
512async_assert_fn!(tokio::sync::watch::Sender<YN>::closed(_): !Send & !Sync & !Unpin);
513async_assert_fn!(tokio::sync::watch::Sender<YY>::closed(_): Send & Sync & !Unpin);
514async_assert_fn!(tokio::task::JoinSet<Cell<u32>>::join_next(_): Send & Sync & !Unpin);
515async_assert_fn!(tokio::task::JoinSet<Cell<u32>>::shutdown(_): Send & Sync & !Unpin);
516async_assert_fn!(tokio::task::JoinSet<Rc<u32>>::join_next(_): !Send & !Sync & !Unpin);
517async_assert_fn!(tokio::task::JoinSet<Rc<u32>>::shutdown(_): !Send & !Sync & !Unpin);
518async_assert_fn!(tokio::task::JoinSet<u32>::join_next(_): Send & Sync & !Unpin);
519async_assert_fn!(tokio::task::JoinSet<u32>::shutdown(_): Send & Sync & !Unpin);
520async_assert_fn!(tokio::task::LocalKey<Cell<u32>>::scope(_, Cell<u32>, BoxFuture<()>): !Send & !Sync & !Unpin);
521async_assert_fn!(tokio::task::LocalKey<Cell<u32>>::scope(_, Cell<u32>, BoxFutureSend<()>): Send & !Sync & !Unpin);
522async_assert_fn!(tokio::task::LocalKey<Cell<u32>>::scope(_, Cell<u32>, BoxFutureSync<()>): Send & !Sync & !Unpin);
523async_assert_fn!(tokio::task::LocalKey<Rc<u32>>::scope(_, Rc<u32>, BoxFuture<()>): !Send & !Sync & !Unpin);
524async_assert_fn!(tokio::task::LocalKey<Rc<u32>>::scope(_, Rc<u32>, BoxFutureSend<()>): !Send & !Sync & !Unpin);
525async_assert_fn!(tokio::task::LocalKey<Rc<u32>>::scope(_, Rc<u32>, BoxFutureSync<()>): !Send & !Sync & !Unpin);
526async_assert_fn!(tokio::task::LocalKey<u32>::scope(_, u32, BoxFuture<()>): !Send & !Sync & !Unpin);
527async_assert_fn!(tokio::task::LocalKey<u32>::scope(_, u32, BoxFutureSend<()>): Send & !Sync & !Unpin);
528async_assert_fn!(tokio::task::LocalKey<u32>::scope(_, u32, BoxFutureSync<()>): Send & Sync & !Unpin);
529async_assert_fn!(tokio::task::LocalSet::run_until(_, BoxFutureSync<()>): !Send & !Sync & !Unpin);
530async_assert_fn!(tokio::task::unconstrained(BoxFuture<()>): !Send & !Sync & Unpin);
531async_assert_fn!(tokio::task::unconstrained(BoxFutureSend<()>): Send & !Sync & Unpin);
532async_assert_fn!(tokio::task::unconstrained(BoxFutureSync<()>): Send & Sync & Unpin);
533
534assert_value!(tokio::runtime::Builder: Send & Sync & Unpin);
535assert_value!(tokio::runtime::EnterGuard<'_>: !Send & Sync & Unpin);
536assert_value!(tokio::runtime::Handle: Send & Sync & Unpin);
537assert_value!(tokio::runtime::Runtime: Send & Sync & Unpin);
538
539assert_value!(tokio::time::Interval: Send & Sync & Unpin);
540assert_value!(tokio::time::Instant: Send & Sync & Unpin);
541assert_value!(tokio::time::Sleep: Send & Sync & !Unpin);
542assert_value!(tokio::time::Timeout<BoxFutureSync<()>>: Send & Sync & !Unpin);
543assert_value!(tokio::time::Timeout<BoxFutureSend<()>>: Send & !Sync & !Unpin);
544assert_value!(tokio::time::Timeout<BoxFuture<()>>: !Send & !Sync & !Unpin);
545assert_value!(tokio::time::error::Elapsed: Send & Sync & Unpin);
546assert_value!(tokio::time::error::Error: Send & Sync & Unpin);
547async_assert_fn!(tokio::time::advance(Duration): Send & Sync & !Unpin);
548async_assert_fn!(tokio::time::sleep(Duration): Send & Sync & !Unpin);
549async_assert_fn!(tokio::time::sleep_until(Instant): Send & Sync & !Unpin);
550async_assert_fn!(tokio::time::timeout(Duration, BoxFutureSync<()>): Send & Sync & !Unpin);
551async_assert_fn!(tokio::time::timeout(Duration, BoxFutureSend<()>): Send & !Sync & !Unpin);
552async_assert_fn!(tokio::time::timeout(Duration, BoxFuture<()>): !Send & !Sync & !Unpin);
553async_assert_fn!(tokio::time::timeout_at(Instant, BoxFutureSync<()>): Send & Sync & !Unpin);
554async_assert_fn!(tokio::time::timeout_at(Instant, BoxFutureSend<()>): Send & !Sync & !Unpin);
555async_assert_fn!(tokio::time::timeout_at(Instant, BoxFuture<()>): !Send & !Sync & !Unpin);
556async_assert_fn!(tokio::time::Interval::tick(_): Send & Sync & !Unpin);
557
558assert_value!(tokio::io::BufReader<TcpStream>: Send & Sync & Unpin);
559assert_value!(tokio::io::BufStream<TcpStream>: Send & Sync & Unpin);
560assert_value!(tokio::io::BufWriter<TcpStream>: Send & Sync & Unpin);
561assert_value!(tokio::io::DuplexStream: Send & Sync & Unpin);
562assert_value!(tokio::io::Empty: Send & Sync & Unpin);
563assert_value!(tokio::io::Interest: Send & Sync & Unpin);
564assert_value!(tokio::io::Lines<TcpStream>: Send & Sync & Unpin);
565assert_value!(tokio::io::ReadBuf<'_>: Send & Sync & Unpin);
566assert_value!(tokio::io::ReadHalf<TcpStream>: Send & Sync & Unpin);
567assert_value!(tokio::io::Ready: Send & Sync & Unpin);
568assert_value!(tokio::io::Repeat: Send & Sync & Unpin);
569assert_value!(tokio::io::Sink: Send & Sync & Unpin);
570assert_value!(tokio::io::Split<TcpStream>: Send & Sync & Unpin);
571assert_value!(tokio::io::Stderr: Send & Sync & Unpin);
572assert_value!(tokio::io::Stdin: Send & Sync & Unpin);
573assert_value!(tokio::io::Stdout: Send & Sync & Unpin);
574assert_value!(tokio::io::Take<TcpStream>: Send & Sync & Unpin);
575assert_value!(tokio::io::WriteHalf<TcpStream>: Send & Sync & Unpin);
576async_assert_fn!(tokio::io::copy(&mut TcpStream, &mut TcpStream): Send & Sync & !Unpin);
577async_assert_fn!(
578 tokio::io::copy_bidirectional(&mut TcpStream, &mut TcpStream): Send & Sync & !Unpin
579);
580async_assert_fn!(tokio::io::copy_buf(&mut tokio::io::BufReader<TcpStream>, &mut TcpStream): Send & Sync & !Unpin);
581async_assert_fn!(tokio::io::empty(): Send & Sync & Unpin);
582async_assert_fn!(tokio::io::repeat(u8): Send & Sync & Unpin);
583async_assert_fn!(tokio::io::sink(): Send & Sync & Unpin);
584async_assert_fn!(tokio::io::split(TcpStream): Send & Sync & Unpin);
585async_assert_fn!(tokio::io::stderr(): Send & Sync & Unpin);
586async_assert_fn!(tokio::io::stdin(): Send & Sync & Unpin);
587async_assert_fn!(tokio::io::stdout(): Send & Sync & Unpin);
588async_assert_fn!(tokio::io::Split<tokio::io::BufReader<TcpStream>>::next_segment(_): Send & Sync & !Unpin);
589async_assert_fn!(tokio::io::Lines<tokio::io::BufReader<TcpStream>>::next_line(_): Send & Sync & !Unpin);
590async_assert_fn!(tokio::io::AsyncBufReadExt::read_until(&mut BoxAsyncRead, u8, &mut Vec<u8>): Send & Sync & !Unpin);
591async_assert_fn!(
592 tokio::io::AsyncBufReadExt::read_line(&mut BoxAsyncRead, &mut String): Send & Sync & !Unpin
593);
594async_assert_fn!(tokio::io::AsyncBufReadExt::fill_buf(&mut BoxAsyncRead): Send & Sync & !Unpin);
595async_assert_fn!(tokio::io::AsyncReadExt::read(&mut BoxAsyncRead, &mut [u8]): Send & Sync & !Unpin);
596async_assert_fn!(tokio::io::AsyncReadExt::read_buf(&mut BoxAsyncRead, &mut Vec<u8>): Send & Sync & !Unpin);
597async_assert_fn!(
598 tokio::io::AsyncReadExt::read_exact(&mut BoxAsyncRead, &mut [u8]): Send & Sync & !Unpin
599);
600async_assert_fn!(tokio::io::AsyncReadExt::read_u8(&mut BoxAsyncRead): Send & Sync & !Unpin);
601async_assert_fn!(tokio::io::AsyncReadExt::read_i8(&mut BoxAsyncRead): Send & Sync & !Unpin);
602async_assert_fn!(tokio::io::AsyncReadExt::read_u16(&mut BoxAsyncRead): Send & Sync & !Unpin);
603async_assert_fn!(tokio::io::AsyncReadExt::read_i16(&mut BoxAsyncRead): Send & Sync & !Unpin);
604async_assert_fn!(tokio::io::AsyncReadExt::read_u32(&mut BoxAsyncRead): Send & Sync & !Unpin);
605async_assert_fn!(tokio::io::AsyncReadExt::read_i32(&mut BoxAsyncRead): Send & Sync & !Unpin);
606async_assert_fn!(tokio::io::AsyncReadExt::read_u64(&mut BoxAsyncRead): Send & Sync & !Unpin);
607async_assert_fn!(tokio::io::AsyncReadExt::read_i64(&mut BoxAsyncRead): Send & Sync & !Unpin);
608async_assert_fn!(tokio::io::AsyncReadExt::read_u128(&mut BoxAsyncRead): Send & Sync & !Unpin);
609async_assert_fn!(tokio::io::AsyncReadExt::read_i128(&mut BoxAsyncRead): Send & Sync & !Unpin);
610async_assert_fn!(tokio::io::AsyncReadExt::read_f32(&mut BoxAsyncRead): Send & Sync & !Unpin);
611async_assert_fn!(tokio::io::AsyncReadExt::read_f64(&mut BoxAsyncRead): Send & Sync & !Unpin);
612async_assert_fn!(tokio::io::AsyncReadExt::read_u16_le(&mut BoxAsyncRead): Send & Sync & !Unpin);
613async_assert_fn!(tokio::io::AsyncReadExt::read_i16_le(&mut BoxAsyncRead): Send & Sync & !Unpin);
614async_assert_fn!(tokio::io::AsyncReadExt::read_u32_le(&mut BoxAsyncRead): Send & Sync & !Unpin);
615async_assert_fn!(tokio::io::AsyncReadExt::read_i32_le(&mut BoxAsyncRead): Send & Sync & !Unpin);
616async_assert_fn!(tokio::io::AsyncReadExt::read_u64_le(&mut BoxAsyncRead): Send & Sync & !Unpin);
617async_assert_fn!(tokio::io::AsyncReadExt::read_i64_le(&mut BoxAsyncRead): Send & Sync & !Unpin);
618async_assert_fn!(tokio::io::AsyncReadExt::read_u128_le(&mut BoxAsyncRead): Send & Sync & !Unpin);
619async_assert_fn!(tokio::io::AsyncReadExt::read_i128_le(&mut BoxAsyncRead): Send & Sync & !Unpin);
620async_assert_fn!(tokio::io::AsyncReadExt::read_f32_le(&mut BoxAsyncRead): Send & Sync & !Unpin);
621async_assert_fn!(tokio::io::AsyncReadExt::read_f64_le(&mut BoxAsyncRead): Send & Sync & !Unpin);
622async_assert_fn!(tokio::io::AsyncReadExt::read_to_end(&mut BoxAsyncRead, &mut Vec<u8>): Send & Sync & !Unpin);
623async_assert_fn!(
624 tokio::io::AsyncReadExt::read_to_string(&mut BoxAsyncRead, &mut String): Send & Sync & !Unpin
625);
626async_assert_fn!(tokio::io::AsyncSeekExt::seek(&mut BoxAsyncSeek, SeekFrom): Send & Sync & !Unpin);
627async_assert_fn!(tokio::io::AsyncSeekExt::stream_position(&mut BoxAsyncSeek): Send & Sync & !Unpin);
628async_assert_fn!(tokio::io::AsyncWriteExt::write(&mut BoxAsyncWrite, &[u8]): Send & Sync & !Unpin);
629async_assert_fn!(
630 tokio::io::AsyncWriteExt::write_vectored(&mut BoxAsyncWrite, _): Send & Sync & !Unpin
631);
632async_assert_fn!(
633 tokio::io::AsyncWriteExt::write_buf(&mut BoxAsyncWrite, &mut bytes::Bytes): Send
634 & Sync
635 & !Unpin
636);
637async_assert_fn!(
638 tokio::io::AsyncWriteExt::write_all_buf(&mut BoxAsyncWrite, &mut bytes::Bytes): Send
639 & Sync
640 & !Unpin
641);
642async_assert_fn!(
643 tokio::io::AsyncWriteExt::write_all(&mut BoxAsyncWrite, &[u8]): Send & Sync & !Unpin
644);
645async_assert_fn!(tokio::io::AsyncWriteExt::write_u8(&mut BoxAsyncWrite, u8): Send & Sync & !Unpin);
646async_assert_fn!(tokio::io::AsyncWriteExt::write_i8(&mut BoxAsyncWrite, i8): Send & Sync & !Unpin);
647async_assert_fn!(
648 tokio::io::AsyncWriteExt::write_u16(&mut BoxAsyncWrite, u16): Send & Sync & !Unpin
649);
650async_assert_fn!(
651 tokio::io::AsyncWriteExt::write_i16(&mut BoxAsyncWrite, i16): Send & Sync & !Unpin
652);
653async_assert_fn!(
654 tokio::io::AsyncWriteExt::write_u32(&mut BoxAsyncWrite, u32): Send & Sync & !Unpin
655);
656async_assert_fn!(
657 tokio::io::AsyncWriteExt::write_i32(&mut BoxAsyncWrite, i32): Send & Sync & !Unpin
658);
659async_assert_fn!(
660 tokio::io::AsyncWriteExt::write_u64(&mut BoxAsyncWrite, u64): Send & Sync & !Unpin
661);
662async_assert_fn!(
663 tokio::io::AsyncWriteExt::write_i64(&mut BoxAsyncWrite, i64): Send & Sync & !Unpin
664);
665async_assert_fn!(
666 tokio::io::AsyncWriteExt::write_u128(&mut BoxAsyncWrite, u128): Send & Sync & !Unpin
667);
668async_assert_fn!(
669 tokio::io::AsyncWriteExt::write_i128(&mut BoxAsyncWrite, i128): Send & Sync & !Unpin
670);
671async_assert_fn!(
672 tokio::io::AsyncWriteExt::write_f32(&mut BoxAsyncWrite, f32): Send & Sync & !Unpin
673);
674async_assert_fn!(
675 tokio::io::AsyncWriteExt::write_f64(&mut BoxAsyncWrite, f64): Send & Sync & !Unpin
676);
677async_assert_fn!(
678 tokio::io::AsyncWriteExt::write_u16_le(&mut BoxAsyncWrite, u16): Send & Sync & !Unpin
679);
680async_assert_fn!(
681 tokio::io::AsyncWriteExt::write_i16_le(&mut BoxAsyncWrite, i16): Send & Sync & !Unpin
682);
683async_assert_fn!(
684 tokio::io::AsyncWriteExt::write_u32_le(&mut BoxAsyncWrite, u32): Send & Sync & !Unpin
685);
686async_assert_fn!(
687 tokio::io::AsyncWriteExt::write_i32_le(&mut BoxAsyncWrite, i32): Send & Sync & !Unpin
688);
689async_assert_fn!(
690 tokio::io::AsyncWriteExt::write_u64_le(&mut BoxAsyncWrite, u64): Send & Sync & !Unpin
691);
692async_assert_fn!(
693 tokio::io::AsyncWriteExt::write_i64_le(&mut BoxAsyncWrite, i64): Send & Sync & !Unpin
694);
695async_assert_fn!(
696 tokio::io::AsyncWriteExt::write_u128_le(&mut BoxAsyncWrite, u128): Send & Sync & !Unpin
697);
698async_assert_fn!(
699 tokio::io::AsyncWriteExt::write_i128_le(&mut BoxAsyncWrite, i128): Send & Sync & !Unpin
700);
701async_assert_fn!(
702 tokio::io::AsyncWriteExt::write_f32_le(&mut BoxAsyncWrite, f32): Send & Sync & !Unpin
703);
704async_assert_fn!(
705 tokio::io::AsyncWriteExt::write_f64_le(&mut BoxAsyncWrite, f64): Send & Sync & !Unpin
706);
707async_assert_fn!(tokio::io::AsyncWriteExt::flush(&mut BoxAsyncWrite): Send & Sync & !Unpin);
708async_assert_fn!(tokio::io::AsyncWriteExt::shutdown(&mut BoxAsyncWrite): Send & Sync & !Unpin);
709
710#[cfg(unix)]
711mod unix_asyncfd {
712 use super::*;
713 use tokio::io::unix::*;
714
715 struct ImplsFd<T> {
716 _t: T,
717 }
718 impl<T> std::os::unix::io::AsRawFd for ImplsFd<T> {
719 fn as_raw_fd(&self) -> std::os::unix::io::RawFd {
720 unreachable!()
721 }
722 }
723
724 assert_value!(AsyncFd<ImplsFd<YY>>: Send & Sync & Unpin);
725 assert_value!(AsyncFd<ImplsFd<YN>>: Send & !Sync & Unpin);
726 assert_value!(AsyncFd<ImplsFd<NN>>: !Send & !Sync & Unpin);
727 assert_value!(AsyncFdReadyGuard<'_, ImplsFd<YY>>: Send & Sync & Unpin);
728 assert_value!(AsyncFdReadyGuard<'_, ImplsFd<YN>>: !Send & !Sync & Unpin);
729 assert_value!(AsyncFdReadyGuard<'_, ImplsFd<NN>>: !Send & !Sync & Unpin);
730 assert_value!(AsyncFdReadyMutGuard<'_, ImplsFd<YY>>: Send & Sync & Unpin);
731 assert_value!(AsyncFdReadyMutGuard<'_, ImplsFd<YN>>: Send & !Sync & Unpin);
732 assert_value!(AsyncFdReadyMutGuard<'_, ImplsFd<NN>>: !Send & !Sync & Unpin);
733 assert_value!(TryIoError: Send & Sync & Unpin);
734 async_assert_fn!(AsyncFd<ImplsFd<YY>>::readable(_): Send & Sync & !Unpin);
735 async_assert_fn!(AsyncFd<ImplsFd<YY>>::readable_mut(_): Send & Sync & !Unpin);
736 async_assert_fn!(AsyncFd<ImplsFd<YY>>::writable(_): Send & Sync & !Unpin);
737 async_assert_fn!(AsyncFd<ImplsFd<YY>>::writable_mut(_): Send & Sync & !Unpin);
738 async_assert_fn!(AsyncFd<ImplsFd<YN>>::readable(_): !Send & !Sync & !Unpin);
739 async_assert_fn!(AsyncFd<ImplsFd<YN>>::readable_mut(_): Send & !Sync & !Unpin);
740 async_assert_fn!(AsyncFd<ImplsFd<YN>>::writable(_): !Send & !Sync & !Unpin);
741 async_assert_fn!(AsyncFd<ImplsFd<YN>>::writable_mut(_): Send & !Sync & !Unpin);
742 async_assert_fn!(AsyncFd<ImplsFd<NN>>::readable(_): !Send & !Sync & !Unpin);
743 async_assert_fn!(AsyncFd<ImplsFd<NN>>::readable_mut(_): !Send & !Sync & !Unpin);
744 async_assert_fn!(AsyncFd<ImplsFd<NN>>::writable(_): !Send & !Sync & !Unpin);
745 async_assert_fn!(AsyncFd<ImplsFd<NN>>::writable_mut(_): !Send & !Sync & !Unpin);
746}
747