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)] |
46 | fn require_send<T: Send>(_t: &T) {} |
47 | #[allow (dead_code)] |
48 | fn require_sync<T: Sync>(_t: &T) {} |
49 | #[allow (dead_code)] |
50 | fn require_unpin<T: Unpin>(_t: &T) {} |
51 | |
52 | #[allow (dead_code)] |
53 | struct Invalid; |
54 | |
55 | trait AmbiguousIfSend<A> { |
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> { |
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> { |
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(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. |
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 (unix)] |
267 | mod 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)] |
280 | mod 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 | |
299 | cfg_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)] |
316 | mod 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)] |
323 | mod 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 | |
331 | assert_value!(tokio::sync::AcquireError: Send & Sync & Unpin); |
332 | assert_value!(tokio::sync::Barrier: Send & Sync & Unpin); |
333 | assert_value!(tokio::sync::BarrierWaitResult: Send & Sync & Unpin); |
334 | assert_value!(tokio::sync::MappedMutexGuard<'_, NN>: !Send & !Sync & Unpin); |
335 | assert_value!(tokio::sync::MappedMutexGuard<'_, YN>: Send & !Sync & Unpin); |
336 | assert_value!(tokio::sync::MappedMutexGuard<'_, YY>: Send & Sync & Unpin); |
337 | assert_value!(tokio::sync::Mutex<NN>: !Send & !Sync & Unpin); |
338 | assert_value!(tokio::sync::Mutex<YN>: Send & Sync & Unpin); |
339 | assert_value!(tokio::sync::Mutex<YY>: Send & Sync & Unpin); |
340 | assert_value!(tokio::sync::MutexGuard<'_, NN>: !Send & !Sync & Unpin); |
341 | assert_value!(tokio::sync::MutexGuard<'_, YN>: Send & !Sync & Unpin); |
342 | assert_value!(tokio::sync::MutexGuard<'_, YY>: Send & Sync & Unpin); |
343 | assert_value!(tokio::sync::Notify: Send & Sync & Unpin); |
344 | assert_value!(tokio::sync::OnceCell<NN>: !Send & !Sync & Unpin); |
345 | assert_value!(tokio::sync::OnceCell<YN>: Send & !Sync & Unpin); |
346 | assert_value!(tokio::sync::OnceCell<YY>: Send & Sync & Unpin); |
347 | assert_value!(tokio::sync::OwnedMutexGuard<NN>: !Send & !Sync & Unpin); |
348 | assert_value!(tokio::sync::OwnedMutexGuard<YN>: Send & !Sync & Unpin); |
349 | assert_value!(tokio::sync::OwnedMutexGuard<YY>: Send & Sync & Unpin); |
350 | assert_value!(tokio::sync::OwnedMappedMutexGuard<NN,NN>: !Send & !Sync & Unpin); |
351 | assert_value!(tokio::sync::OwnedMappedMutexGuard<NN,YN>: !Send & !Sync & Unpin); |
352 | assert_value!(tokio::sync::OwnedMappedMutexGuard<NN,YY>: !Send & !Sync & Unpin); |
353 | assert_value!(tokio::sync::OwnedMappedMutexGuard<YN,NN>: !Send & !Sync & Unpin); |
354 | assert_value!(tokio::sync::OwnedMappedMutexGuard<YN,YN>: Send & !Sync & Unpin); |
355 | assert_value!(tokio::sync::OwnedMappedMutexGuard<YN,YY>: Send & !Sync & Unpin); |
356 | assert_value!(tokio::sync::OwnedMappedMutexGuard<YY,NN>: !Send & !Sync & Unpin); |
357 | assert_value!(tokio::sync::OwnedMappedMutexGuard<YY,YN>: Send & !Sync & Unpin); |
358 | assert_value!(tokio::sync::OwnedMappedMutexGuard<YY,YY>: Send & Sync & Unpin); |
359 | assert_value!(tokio::sync::OwnedRwLockMappedWriteGuard<NN>: !Send & !Sync & Unpin); |
360 | assert_value!(tokio::sync::OwnedRwLockMappedWriteGuard<YN>: !Send & !Sync & Unpin); |
361 | assert_value!(tokio::sync::OwnedRwLockMappedWriteGuard<YY>: Send & Sync & Unpin); |
362 | assert_value!(tokio::sync::OwnedRwLockReadGuard<NN>: !Send & !Sync & Unpin); |
363 | assert_value!(tokio::sync::OwnedRwLockReadGuard<YN>: !Send & !Sync & Unpin); |
364 | assert_value!(tokio::sync::OwnedRwLockReadGuard<YY>: Send & Sync & Unpin); |
365 | assert_value!(tokio::sync::OwnedRwLockWriteGuard<NN>: !Send & !Sync & Unpin); |
366 | assert_value!(tokio::sync::OwnedRwLockWriteGuard<YN>: !Send & !Sync & Unpin); |
367 | assert_value!(tokio::sync::OwnedRwLockWriteGuard<YY>: Send & Sync & Unpin); |
368 | assert_value!(tokio::sync::OwnedSemaphorePermit: Send & Sync & Unpin); |
369 | assert_value!(tokio::sync::RwLock<NN>: !Send & !Sync & Unpin); |
370 | assert_value!(tokio::sync::RwLock<YN>: Send & !Sync & Unpin); |
371 | assert_value!(tokio::sync::RwLock<YY>: Send & Sync & Unpin); |
372 | assert_value!(tokio::sync::RwLockMappedWriteGuard<'_, NN>: !Send & !Sync & Unpin); |
373 | assert_value!(tokio::sync::RwLockMappedWriteGuard<'_, YN>: !Send & !Sync & Unpin); |
374 | assert_value!(tokio::sync::RwLockMappedWriteGuard<'_, YY>: Send & Sync & Unpin); |
375 | assert_value!(tokio::sync::RwLockReadGuard<'_, NN>: !Send & !Sync & Unpin); |
376 | assert_value!(tokio::sync::RwLockReadGuard<'_, YN>: !Send & !Sync & Unpin); |
377 | assert_value!(tokio::sync::RwLockReadGuard<'_, YY>: Send & Sync & Unpin); |
378 | assert_value!(tokio::sync::RwLockWriteGuard<'_, NN>: !Send & !Sync & Unpin); |
379 | assert_value!(tokio::sync::RwLockWriteGuard<'_, YN>: !Send & !Sync & Unpin); |
380 | assert_value!(tokio::sync::RwLockWriteGuard<'_, YY>: Send & Sync & Unpin); |
381 | assert_value!(tokio::sync::Semaphore: Send & Sync & Unpin); |
382 | assert_value!(tokio::sync::SemaphorePermit<'_>: Send & Sync & Unpin); |
383 | assert_value!(tokio::sync::TryAcquireError: Send & Sync & Unpin); |
384 | assert_value!(tokio::sync::TryLockError: Send & Sync & Unpin); |
385 | assert_value!(tokio::sync::broadcast::Receiver<NN>: !Send & !Sync & Unpin); |
386 | assert_value!(tokio::sync::broadcast::Receiver<YN>: Send & Sync & Unpin); |
387 | assert_value!(tokio::sync::broadcast::Receiver<YY>: Send & Sync & Unpin); |
388 | assert_value!(tokio::sync::broadcast::Sender<NN>: !Send & !Sync & Unpin); |
389 | assert_value!(tokio::sync::broadcast::Sender<YN>: Send & Sync & Unpin); |
390 | assert_value!(tokio::sync::broadcast::Sender<YY>: Send & Sync & Unpin); |
391 | assert_value!(tokio::sync::futures::Notified<'_>: Send & Sync & !Unpin); |
392 | assert_value!(tokio::sync::mpsc::OwnedPermit<NN>: !Send & !Sync & Unpin); |
393 | assert_value!(tokio::sync::mpsc::OwnedPermit<YN>: Send & Sync & Unpin); |
394 | assert_value!(tokio::sync::mpsc::OwnedPermit<YY>: Send & Sync & Unpin); |
395 | assert_value!(tokio::sync::mpsc::Permit<'_, NN>: !Send & !Sync & Unpin); |
396 | assert_value!(tokio::sync::mpsc::Permit<'_, YN>: Send & Sync & Unpin); |
397 | assert_value!(tokio::sync::mpsc::Permit<'_, YY>: Send & Sync & Unpin); |
398 | assert_value!(tokio::sync::mpsc::Receiver<NN>: !Send & !Sync & Unpin); |
399 | assert_value!(tokio::sync::mpsc::Receiver<YN>: Send & Sync & Unpin); |
400 | assert_value!(tokio::sync::mpsc::Receiver<YY>: Send & Sync & Unpin); |
401 | assert_value!(tokio::sync::mpsc::Sender<NN>: !Send & !Sync & Unpin); |
402 | assert_value!(tokio::sync::mpsc::Sender<YN>: Send & Sync & Unpin); |
403 | assert_value!(tokio::sync::mpsc::Sender<YY>: Send & Sync & Unpin); |
404 | assert_value!(tokio::sync::mpsc::UnboundedReceiver<NN>: !Send & !Sync & Unpin); |
405 | assert_value!(tokio::sync::mpsc::UnboundedReceiver<YN>: Send & Sync & Unpin); |
406 | assert_value!(tokio::sync::mpsc::UnboundedReceiver<YY>: Send & Sync & Unpin); |
407 | assert_value!(tokio::sync::mpsc::UnboundedSender<NN>: !Send & !Sync & Unpin); |
408 | assert_value!(tokio::sync::mpsc::UnboundedSender<YN>: Send & Sync & Unpin); |
409 | assert_value!(tokio::sync::mpsc::UnboundedSender<YY>: Send & Sync & Unpin); |
410 | assert_value!(tokio::sync::mpsc::error::SendError<NN>: !Send & !Sync & Unpin); |
411 | assert_value!(tokio::sync::mpsc::error::SendError<YN>: Send & !Sync & Unpin); |
412 | assert_value!(tokio::sync::mpsc::error::SendError<YY>: Send & Sync & Unpin); |
413 | assert_value!(tokio::sync::mpsc::error::SendTimeoutError<NN>: !Send & !Sync & Unpin); |
414 | assert_value!(tokio::sync::mpsc::error::SendTimeoutError<YN>: Send & !Sync & Unpin); |
415 | assert_value!(tokio::sync::mpsc::error::SendTimeoutError<YY>: Send & Sync & Unpin); |
416 | assert_value!(tokio::sync::mpsc::error::TrySendError<NN>: !Send & !Sync & Unpin); |
417 | assert_value!(tokio::sync::mpsc::error::TrySendError<YN>: Send & !Sync & Unpin); |
418 | assert_value!(tokio::sync::mpsc::error::TrySendError<YY>: Send & Sync & Unpin); |
419 | assert_value!(tokio::sync::oneshot::Receiver<NN>: !Send & !Sync & Unpin); |
420 | assert_value!(tokio::sync::oneshot::Receiver<YN>: Send & Sync & Unpin); |
421 | assert_value!(tokio::sync::oneshot::Receiver<YY>: Send & Sync & Unpin); |
422 | assert_value!(tokio::sync::oneshot::Sender<NN>: !Send & !Sync & Unpin); |
423 | assert_value!(tokio::sync::oneshot::Sender<YN>: Send & Sync & Unpin); |
424 | assert_value!(tokio::sync::oneshot::Sender<YY>: Send & Sync & Unpin); |
425 | assert_value!(tokio::sync::watch::Receiver<NN>: !Send & !Sync & Unpin); |
426 | assert_value!(tokio::sync::watch::Receiver<YN>: !Send & !Sync & Unpin); |
427 | assert_value!(tokio::sync::watch::Receiver<YY>: Send & Sync & Unpin); |
428 | assert_value!(tokio::sync::watch::Ref<'_, NN>: !Send & !Sync & Unpin); |
429 | assert_value!(tokio::sync::watch::Ref<'_, YN>: !Send & !Sync & Unpin); |
430 | assert_value!(tokio::sync::watch::Ref<'_, YY>: !Send & Sync & Unpin); |
431 | assert_value!(tokio::sync::watch::Sender<NN>: !Send & !Sync & Unpin); |
432 | assert_value!(tokio::sync::watch::Sender<YN>: !Send & !Sync & Unpin); |
433 | assert_value!(tokio::sync::watch::Sender<YY>: Send & Sync & Unpin); |
434 | assert_value!(tokio::task::JoinError: Send & Sync & Unpin); |
435 | assert_value!(tokio::task::JoinHandle<NN>: !Send & !Sync & Unpin); |
436 | assert_value!(tokio::task::JoinHandle<YN>: Send & Sync & Unpin); |
437 | assert_value!(tokio::task::JoinHandle<YY>: Send & Sync & Unpin); |
438 | assert_value!(tokio::task::JoinSet<NN>: !Send & !Sync & Unpin); |
439 | assert_value!(tokio::task::JoinSet<YN>: Send & Sync & Unpin); |
440 | assert_value!(tokio::task::JoinSet<YY>: Send & Sync & Unpin); |
441 | assert_value!(tokio::task::LocalSet: !Send & !Sync & Unpin); |
442 | async_assert_fn!(tokio::sync::Barrier::wait(_): Send & Sync & !Unpin); |
443 | async_assert_fn!(tokio::sync::Mutex<NN>::lock(_): !Send & !Sync & !Unpin); |
444 | async_assert_fn!(tokio::sync::Mutex<NN>::lock_owned(_): !Send & !Sync & !Unpin); |
445 | async_assert_fn!(tokio::sync::Mutex<YN>::lock(_): Send & Sync & !Unpin); |
446 | async_assert_fn!(tokio::sync::Mutex<YN>::lock_owned(_): Send & Sync & !Unpin); |
447 | async_assert_fn!(tokio::sync::Mutex<YY>::lock(_): Send & Sync & !Unpin); |
448 | async_assert_fn!(tokio::sync::Mutex<YY>::lock_owned(_): Send & Sync & !Unpin); |
449 | async_assert_fn!(tokio::sync::Notify::notified(_): Send & Sync & !Unpin); |
450 | async_assert_fn!(tokio::sync::OnceCell<NN>::get_or_init( _, fn() -> Pin<Box<dyn Future<Output = NN> + Send + Sync>>): !Send & !Sync & !Unpin); |
451 | async_assert_fn!(tokio::sync::OnceCell<NN>::get_or_init( _, fn() -> Pin<Box<dyn Future<Output = NN> + Send>>): !Send & !Sync & !Unpin); |
452 | async_assert_fn!(tokio::sync::OnceCell<NN>::get_or_init( _, fn() -> Pin<Box<dyn Future<Output = NN>>>): !Send & !Sync & !Unpin); |
453 | 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); |
454 | 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); |
455 | async_assert_fn!(tokio::sync::OnceCell<NN>::get_or_try_init( _, fn() -> Pin<Box<dyn Future<Output = std::io::Result<NN>>>>): !Send & !Sync & !Unpin); |
456 | async_assert_fn!(tokio::sync::OnceCell<YN>::get_or_init( _, fn() -> Pin<Box<dyn Future<Output = YN> + Send + Sync>>): !Send & !Sync & !Unpin); |
457 | async_assert_fn!(tokio::sync::OnceCell<YN>::get_or_init( _, fn() -> Pin<Box<dyn Future<Output = YN> + Send>>): !Send & !Sync & !Unpin); |
458 | async_assert_fn!(tokio::sync::OnceCell<YN>::get_or_init( _, fn() -> Pin<Box<dyn Future<Output = YN>>>): !Send & !Sync & !Unpin); |
459 | 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); |
460 | 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); |
461 | async_assert_fn!(tokio::sync::OnceCell<YN>::get_or_try_init( _, fn() -> Pin<Box<dyn Future<Output = std::io::Result<YN>>>>): !Send & !Sync & !Unpin); |
462 | async_assert_fn!(tokio::sync::OnceCell<YY>::get_or_init( _, fn() -> Pin<Box<dyn Future<Output = YY> + Send + Sync>>): Send & Sync & !Unpin); |
463 | async_assert_fn!(tokio::sync::OnceCell<YY>::get_or_init( _, fn() -> Pin<Box<dyn Future<Output = YY> + Send>>): Send & !Sync & !Unpin); |
464 | async_assert_fn!(tokio::sync::OnceCell<YY>::get_or_init( _, fn() -> Pin<Box<dyn Future<Output = YY>>>): !Send & !Sync & !Unpin); |
465 | 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); |
466 | 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); |
467 | async_assert_fn!(tokio::sync::OnceCell<YY>::get_or_try_init( _, fn() -> Pin<Box<dyn Future<Output = std::io::Result<YY>>>>): !Send & !Sync & !Unpin); |
468 | async_assert_fn!(tokio::sync::RwLock<NN>::read(_): !Send & !Sync & !Unpin); |
469 | async_assert_fn!(tokio::sync::RwLock<NN>::write(_): !Send & !Sync & !Unpin); |
470 | async_assert_fn!(tokio::sync::RwLock<YN>::read(_): !Send & !Sync & !Unpin); |
471 | async_assert_fn!(tokio::sync::RwLock<YN>::write(_): !Send & !Sync & !Unpin); |
472 | async_assert_fn!(tokio::sync::RwLock<YY>::read(_): Send & Sync & !Unpin); |
473 | async_assert_fn!(tokio::sync::RwLock<YY>::write(_): Send & Sync & !Unpin); |
474 | async_assert_fn!(tokio::sync::Semaphore::acquire(_): Send & Sync & !Unpin); |
475 | async_assert_fn!(tokio::sync::Semaphore::acquire_many(_, u32): Send & Sync & !Unpin); |
476 | async_assert_fn!(tokio::sync::Semaphore::acquire_many_owned(_, u32): Send & Sync & !Unpin); |
477 | async_assert_fn!(tokio::sync::Semaphore::acquire_owned(_): Send & Sync & !Unpin); |
478 | async_assert_fn!(tokio::sync::broadcast::Receiver<NN>::recv(_): !Send & !Sync & !Unpin); |
479 | async_assert_fn!(tokio::sync::broadcast::Receiver<YN>::recv(_): Send & Sync & !Unpin); |
480 | async_assert_fn!(tokio::sync::broadcast::Receiver<YY>::recv(_): Send & Sync & !Unpin); |
481 | async_assert_fn!(tokio::sync::mpsc::Receiver<NN>::recv(_): !Send & !Sync & !Unpin); |
482 | async_assert_fn!(tokio::sync::mpsc::Receiver<YN>::recv(_): Send & Sync & !Unpin); |
483 | async_assert_fn!(tokio::sync::mpsc::Receiver<YY>::recv(_): Send & Sync & !Unpin); |
484 | async_assert_fn!(tokio::sync::mpsc::Sender<NN>::closed(_): !Send & !Sync & !Unpin); |
485 | async_assert_fn!(tokio::sync::mpsc::Sender<NN>::reserve(_): !Send & !Sync & !Unpin); |
486 | async_assert_fn!(tokio::sync::mpsc::Sender<NN>::reserve_owned(_): !Send & !Sync & !Unpin); |
487 | async_assert_fn!(tokio::sync::mpsc::Sender<NN>::send(_, NN): !Send & !Sync & !Unpin); |
488 | async_assert_fn!(tokio::sync::mpsc::Sender<NN>::send_timeout(_, NN, Duration): !Send & !Sync & !Unpin); |
489 | async_assert_fn!(tokio::sync::mpsc::Sender<YN>::closed(_): Send & Sync & !Unpin); |
490 | async_assert_fn!(tokio::sync::mpsc::Sender<YN>::reserve(_): Send & Sync & !Unpin); |
491 | async_assert_fn!(tokio::sync::mpsc::Sender<YN>::reserve_owned(_): Send & Sync & !Unpin); |
492 | async_assert_fn!(tokio::sync::mpsc::Sender<YN>::send(_, YN): Send & !Sync & !Unpin); |
493 | async_assert_fn!(tokio::sync::mpsc::Sender<YN>::send_timeout(_, YN, Duration): Send & !Sync & !Unpin); |
494 | async_assert_fn!(tokio::sync::mpsc::Sender<YY>::closed(_): Send & Sync & !Unpin); |
495 | async_assert_fn!(tokio::sync::mpsc::Sender<YY>::reserve(_): Send & Sync & !Unpin); |
496 | async_assert_fn!(tokio::sync::mpsc::Sender<YY>::reserve_owned(_): Send & Sync & !Unpin); |
497 | async_assert_fn!(tokio::sync::mpsc::Sender<YY>::send(_, YY): Send & Sync & !Unpin); |
498 | async_assert_fn!(tokio::sync::mpsc::Sender<YY>::send_timeout(_, YY, Duration): Send & Sync & !Unpin); |
499 | async_assert_fn!(tokio::sync::mpsc::UnboundedReceiver<NN>::recv(_): !Send & !Sync & !Unpin); |
500 | async_assert_fn!(tokio::sync::mpsc::UnboundedReceiver<YN>::recv(_): Send & Sync & !Unpin); |
501 | async_assert_fn!(tokio::sync::mpsc::UnboundedReceiver<YY>::recv(_): Send & Sync & !Unpin); |
502 | async_assert_fn!(tokio::sync::mpsc::UnboundedSender<NN>::closed(_): !Send & !Sync & !Unpin); |
503 | async_assert_fn!(tokio::sync::mpsc::UnboundedSender<YN>::closed(_): Send & Sync & !Unpin); |
504 | async_assert_fn!(tokio::sync::mpsc::UnboundedSender<YY>::closed(_): Send & Sync & !Unpin); |
505 | async_assert_fn!(tokio::sync::oneshot::Sender<NN>::closed(_): !Send & !Sync & !Unpin); |
506 | async_assert_fn!(tokio::sync::oneshot::Sender<YN>::closed(_): Send & Sync & !Unpin); |
507 | async_assert_fn!(tokio::sync::oneshot::Sender<YY>::closed(_): Send & Sync & !Unpin); |
508 | async_assert_fn!(tokio::sync::watch::Receiver<NN>::changed(_): !Send & !Sync & !Unpin); |
509 | async_assert_fn!(tokio::sync::watch::Receiver<YN>::changed(_): !Send & !Sync & !Unpin); |
510 | async_assert_fn!(tokio::sync::watch::Receiver<YY>::changed(_): Send & Sync & !Unpin); |
511 | async_assert_fn!(tokio::sync::watch::Sender<NN>::closed(_): !Send & !Sync & !Unpin); |
512 | async_assert_fn!(tokio::sync::watch::Sender<YN>::closed(_): !Send & !Sync & !Unpin); |
513 | async_assert_fn!(tokio::sync::watch::Sender<YY>::closed(_): Send & Sync & !Unpin); |
514 | async_assert_fn!(tokio::task::JoinSet<Cell<u32>>::join_next(_): Send & Sync & !Unpin); |
515 | async_assert_fn!(tokio::task::JoinSet<Cell<u32>>::shutdown(_): Send & Sync & !Unpin); |
516 | async_assert_fn!(tokio::task::JoinSet<Rc<u32>>::join_next(_): !Send & !Sync & !Unpin); |
517 | async_assert_fn!(tokio::task::JoinSet<Rc<u32>>::shutdown(_): !Send & !Sync & !Unpin); |
518 | async_assert_fn!(tokio::task::JoinSet<u32>::join_next(_): Send & Sync & !Unpin); |
519 | async_assert_fn!(tokio::task::JoinSet<u32>::shutdown(_): Send & Sync & !Unpin); |
520 | async_assert_fn!(tokio::task::LocalKey<Cell<u32>>::scope(_, Cell<u32>, BoxFuture<()>): !Send & !Sync & !Unpin); |
521 | async_assert_fn!(tokio::task::LocalKey<Cell<u32>>::scope(_, Cell<u32>, BoxFutureSend<()>): Send & !Sync & !Unpin); |
522 | async_assert_fn!(tokio::task::LocalKey<Cell<u32>>::scope(_, Cell<u32>, BoxFutureSync<()>): Send & !Sync & !Unpin); |
523 | async_assert_fn!(tokio::task::LocalKey<Rc<u32>>::scope(_, Rc<u32>, BoxFuture<()>): !Send & !Sync & !Unpin); |
524 | async_assert_fn!(tokio::task::LocalKey<Rc<u32>>::scope(_, Rc<u32>, BoxFutureSend<()>): !Send & !Sync & !Unpin); |
525 | async_assert_fn!(tokio::task::LocalKey<Rc<u32>>::scope(_, Rc<u32>, BoxFutureSync<()>): !Send & !Sync & !Unpin); |
526 | async_assert_fn!(tokio::task::LocalKey<u32>::scope(_, u32, BoxFuture<()>): !Send & !Sync & !Unpin); |
527 | async_assert_fn!(tokio::task::LocalKey<u32>::scope(_, u32, BoxFutureSend<()>): Send & !Sync & !Unpin); |
528 | async_assert_fn!(tokio::task::LocalKey<u32>::scope(_, u32, BoxFutureSync<()>): Send & Sync & !Unpin); |
529 | async_assert_fn!(tokio::task::LocalSet::run_until(_, BoxFutureSync<()>): !Send & !Sync & !Unpin); |
530 | async_assert_fn!(tokio::task::unconstrained(BoxFuture<()>): !Send & !Sync & Unpin); |
531 | async_assert_fn!(tokio::task::unconstrained(BoxFutureSend<()>): Send & !Sync & Unpin); |
532 | async_assert_fn!(tokio::task::unconstrained(BoxFutureSync<()>): Send & Sync & Unpin); |
533 | |
534 | assert_value!(tokio::runtime::Builder: Send & Sync & Unpin); |
535 | assert_value!(tokio::runtime::EnterGuard<'_>: !Send & Sync & Unpin); |
536 | assert_value!(tokio::runtime::Handle: Send & Sync & Unpin); |
537 | assert_value!(tokio::runtime::Runtime: Send & Sync & Unpin); |
538 | |
539 | assert_value!(tokio::time::Interval: Send & Sync & Unpin); |
540 | assert_value!(tokio::time::Instant: Send & Sync & Unpin); |
541 | assert_value!(tokio::time::Sleep: Send & Sync & !Unpin); |
542 | assert_value!(tokio::time::Timeout<BoxFutureSync<()>>: Send & Sync & !Unpin); |
543 | assert_value!(tokio::time::Timeout<BoxFutureSend<()>>: Send & !Sync & !Unpin); |
544 | assert_value!(tokio::time::Timeout<BoxFuture<()>>: !Send & !Sync & !Unpin); |
545 | assert_value!(tokio::time::error::Elapsed: Send & Sync & Unpin); |
546 | assert_value!(tokio::time::error::Error: Send & Sync & Unpin); |
547 | async_assert_fn!(tokio::time::advance(Duration): Send & Sync & !Unpin); |
548 | async_assert_fn!(tokio::time::sleep(Duration): Send & Sync & !Unpin); |
549 | async_assert_fn!(tokio::time::sleep_until(Instant): Send & Sync & !Unpin); |
550 | async_assert_fn!(tokio::time::timeout(Duration, BoxFutureSync<()>): Send & Sync & !Unpin); |
551 | async_assert_fn!(tokio::time::timeout(Duration, BoxFutureSend<()>): Send & !Sync & !Unpin); |
552 | async_assert_fn!(tokio::time::timeout(Duration, BoxFuture<()>): !Send & !Sync & !Unpin); |
553 | async_assert_fn!(tokio::time::timeout_at(Instant, BoxFutureSync<()>): Send & Sync & !Unpin); |
554 | async_assert_fn!(tokio::time::timeout_at(Instant, BoxFutureSend<()>): Send & !Sync & !Unpin); |
555 | async_assert_fn!(tokio::time::timeout_at(Instant, BoxFuture<()>): !Send & !Sync & !Unpin); |
556 | async_assert_fn!(tokio::time::Interval::tick(_): Send & Sync & !Unpin); |
557 | |
558 | assert_value!(tokio::io::BufReader<TcpStream>: Send & Sync & Unpin); |
559 | assert_value!(tokio::io::BufStream<TcpStream>: Send & Sync & Unpin); |
560 | assert_value!(tokio::io::BufWriter<TcpStream>: Send & Sync & Unpin); |
561 | assert_value!(tokio::io::DuplexStream: Send & Sync & Unpin); |
562 | assert_value!(tokio::io::Empty: Send & Sync & Unpin); |
563 | assert_value!(tokio::io::Interest: Send & Sync & Unpin); |
564 | assert_value!(tokio::io::Lines<TcpStream>: Send & Sync & Unpin); |
565 | assert_value!(tokio::io::ReadBuf<'_>: Send & Sync & Unpin); |
566 | assert_value!(tokio::io::ReadHalf<TcpStream>: Send & Sync & Unpin); |
567 | assert_value!(tokio::io::Ready: Send & Sync & Unpin); |
568 | assert_value!(tokio::io::Repeat: Send & Sync & Unpin); |
569 | assert_value!(tokio::io::Sink: Send & Sync & Unpin); |
570 | assert_value!(tokio::io::Split<TcpStream>: Send & Sync & Unpin); |
571 | assert_value!(tokio::io::Stderr: Send & Sync & Unpin); |
572 | assert_value!(tokio::io::Stdin: Send & Sync & Unpin); |
573 | assert_value!(tokio::io::Stdout: Send & Sync & Unpin); |
574 | assert_value!(tokio::io::Take<TcpStream>: Send & Sync & Unpin); |
575 | assert_value!(tokio::io::WriteHalf<TcpStream>: Send & Sync & Unpin); |
576 | async_assert_fn!(tokio::io::copy(&mut TcpStream, &mut TcpStream): Send & Sync & !Unpin); |
577 | async_assert_fn!( |
578 | tokio::io::copy_bidirectional(&mut TcpStream, &mut TcpStream): Send & Sync & !Unpin |
579 | ); |
580 | async_assert_fn!(tokio::io::copy_buf(&mut tokio::io::BufReader<TcpStream>, &mut TcpStream): Send & Sync & !Unpin); |
581 | async_assert_fn!(tokio::io::empty(): Send & Sync & Unpin); |
582 | async_assert_fn!(tokio::io::repeat(u8): Send & Sync & Unpin); |
583 | async_assert_fn!(tokio::io::sink(): Send & Sync & Unpin); |
584 | async_assert_fn!(tokio::io::split(TcpStream): Send & Sync & Unpin); |
585 | async_assert_fn!(tokio::io::stderr(): Send & Sync & Unpin); |
586 | async_assert_fn!(tokio::io::stdin(): Send & Sync & Unpin); |
587 | async_assert_fn!(tokio::io::stdout(): Send & Sync & Unpin); |
588 | async_assert_fn!(tokio::io::Split<tokio::io::BufReader<TcpStream>>::next_segment(_): Send & Sync & !Unpin); |
589 | async_assert_fn!(tokio::io::Lines<tokio::io::BufReader<TcpStream>>::next_line(_): Send & Sync & !Unpin); |
590 | async_assert_fn!(tokio::io::AsyncBufReadExt::read_until(&mut BoxAsyncRead, u8, &mut Vec<u8>): Send & Sync & !Unpin); |
591 | async_assert_fn!( |
592 | tokio::io::AsyncBufReadExt::read_line(&mut BoxAsyncRead, &mut String): Send & Sync & !Unpin |
593 | ); |
594 | async_assert_fn!(tokio::io::AsyncBufReadExt::fill_buf(&mut BoxAsyncRead): Send & Sync & !Unpin); |
595 | async_assert_fn!(tokio::io::AsyncReadExt::read(&mut BoxAsyncRead, &mut [u8]): Send & Sync & !Unpin); |
596 | async_assert_fn!(tokio::io::AsyncReadExt::read_buf(&mut BoxAsyncRead, &mut Vec<u8>): Send & Sync & !Unpin); |
597 | async_assert_fn!( |
598 | tokio::io::AsyncReadExt::read_exact(&mut BoxAsyncRead, &mut [u8]): Send & Sync & !Unpin |
599 | ); |
600 | async_assert_fn!(tokio::io::AsyncReadExt::read_u8(&mut BoxAsyncRead): Send & Sync & !Unpin); |
601 | async_assert_fn!(tokio::io::AsyncReadExt::read_i8(&mut BoxAsyncRead): Send & Sync & !Unpin); |
602 | async_assert_fn!(tokio::io::AsyncReadExt::read_u16(&mut BoxAsyncRead): Send & Sync & !Unpin); |
603 | async_assert_fn!(tokio::io::AsyncReadExt::read_i16(&mut BoxAsyncRead): Send & Sync & !Unpin); |
604 | async_assert_fn!(tokio::io::AsyncReadExt::read_u32(&mut BoxAsyncRead): Send & Sync & !Unpin); |
605 | async_assert_fn!(tokio::io::AsyncReadExt::read_i32(&mut BoxAsyncRead): Send & Sync & !Unpin); |
606 | async_assert_fn!(tokio::io::AsyncReadExt::read_u64(&mut BoxAsyncRead): Send & Sync & !Unpin); |
607 | async_assert_fn!(tokio::io::AsyncReadExt::read_i64(&mut BoxAsyncRead): Send & Sync & !Unpin); |
608 | async_assert_fn!(tokio::io::AsyncReadExt::read_u128(&mut BoxAsyncRead): Send & Sync & !Unpin); |
609 | async_assert_fn!(tokio::io::AsyncReadExt::read_i128(&mut BoxAsyncRead): Send & Sync & !Unpin); |
610 | async_assert_fn!(tokio::io::AsyncReadExt::read_f32(&mut BoxAsyncRead): Send & Sync & !Unpin); |
611 | async_assert_fn!(tokio::io::AsyncReadExt::read_f64(&mut BoxAsyncRead): Send & Sync & !Unpin); |
612 | async_assert_fn!(tokio::io::AsyncReadExt::read_u16_le(&mut BoxAsyncRead): Send & Sync & !Unpin); |
613 | async_assert_fn!(tokio::io::AsyncReadExt::read_i16_le(&mut BoxAsyncRead): Send & Sync & !Unpin); |
614 | async_assert_fn!(tokio::io::AsyncReadExt::read_u32_le(&mut BoxAsyncRead): Send & Sync & !Unpin); |
615 | async_assert_fn!(tokio::io::AsyncReadExt::read_i32_le(&mut BoxAsyncRead): Send & Sync & !Unpin); |
616 | async_assert_fn!(tokio::io::AsyncReadExt::read_u64_le(&mut BoxAsyncRead): Send & Sync & !Unpin); |
617 | async_assert_fn!(tokio::io::AsyncReadExt::read_i64_le(&mut BoxAsyncRead): Send & Sync & !Unpin); |
618 | async_assert_fn!(tokio::io::AsyncReadExt::read_u128_le(&mut BoxAsyncRead): Send & Sync & !Unpin); |
619 | async_assert_fn!(tokio::io::AsyncReadExt::read_i128_le(&mut BoxAsyncRead): Send & Sync & !Unpin); |
620 | async_assert_fn!(tokio::io::AsyncReadExt::read_f32_le(&mut BoxAsyncRead): Send & Sync & !Unpin); |
621 | async_assert_fn!(tokio::io::AsyncReadExt::read_f64_le(&mut BoxAsyncRead): Send & Sync & !Unpin); |
622 | async_assert_fn!(tokio::io::AsyncReadExt::read_to_end(&mut BoxAsyncRead, &mut Vec<u8>): Send & Sync & !Unpin); |
623 | async_assert_fn!( |
624 | tokio::io::AsyncReadExt::read_to_string(&mut BoxAsyncRead, &mut String): Send & Sync & !Unpin |
625 | ); |
626 | async_assert_fn!(tokio::io::AsyncSeekExt::seek(&mut BoxAsyncSeek, SeekFrom): Send & Sync & !Unpin); |
627 | async_assert_fn!(tokio::io::AsyncSeekExt::stream_position(&mut BoxAsyncSeek): Send & Sync & !Unpin); |
628 | async_assert_fn!(tokio::io::AsyncWriteExt::write(&mut BoxAsyncWrite, &[u8]): Send & Sync & !Unpin); |
629 | async_assert_fn!( |
630 | tokio::io::AsyncWriteExt::write_vectored(&mut BoxAsyncWrite, _): Send & Sync & !Unpin |
631 | ); |
632 | async_assert_fn!( |
633 | tokio::io::AsyncWriteExt::write_buf(&mut BoxAsyncWrite, &mut bytes::Bytes): Send |
634 | & Sync |
635 | & !Unpin |
636 | ); |
637 | async_assert_fn!( |
638 | tokio::io::AsyncWriteExt::write_all_buf(&mut BoxAsyncWrite, &mut bytes::Bytes): Send |
639 | & Sync |
640 | & !Unpin |
641 | ); |
642 | async_assert_fn!( |
643 | tokio::io::AsyncWriteExt::write_all(&mut BoxAsyncWrite, &[u8]): Send & Sync & !Unpin |
644 | ); |
645 | async_assert_fn!(tokio::io::AsyncWriteExt::write_u8(&mut BoxAsyncWrite, u8): Send & Sync & !Unpin); |
646 | async_assert_fn!(tokio::io::AsyncWriteExt::write_i8(&mut BoxAsyncWrite, i8): Send & Sync & !Unpin); |
647 | async_assert_fn!( |
648 | tokio::io::AsyncWriteExt::write_u16(&mut BoxAsyncWrite, u16): Send & Sync & !Unpin |
649 | ); |
650 | async_assert_fn!( |
651 | tokio::io::AsyncWriteExt::write_i16(&mut BoxAsyncWrite, i16): Send & Sync & !Unpin |
652 | ); |
653 | async_assert_fn!( |
654 | tokio::io::AsyncWriteExt::write_u32(&mut BoxAsyncWrite, u32): Send & Sync & !Unpin |
655 | ); |
656 | async_assert_fn!( |
657 | tokio::io::AsyncWriteExt::write_i32(&mut BoxAsyncWrite, i32): Send & Sync & !Unpin |
658 | ); |
659 | async_assert_fn!( |
660 | tokio::io::AsyncWriteExt::write_u64(&mut BoxAsyncWrite, u64): Send & Sync & !Unpin |
661 | ); |
662 | async_assert_fn!( |
663 | tokio::io::AsyncWriteExt::write_i64(&mut BoxAsyncWrite, i64): Send & Sync & !Unpin |
664 | ); |
665 | async_assert_fn!( |
666 | tokio::io::AsyncWriteExt::write_u128(&mut BoxAsyncWrite, u128): Send & Sync & !Unpin |
667 | ); |
668 | async_assert_fn!( |
669 | tokio::io::AsyncWriteExt::write_i128(&mut BoxAsyncWrite, i128): Send & Sync & !Unpin |
670 | ); |
671 | async_assert_fn!( |
672 | tokio::io::AsyncWriteExt::write_f32(&mut BoxAsyncWrite, f32): Send & Sync & !Unpin |
673 | ); |
674 | async_assert_fn!( |
675 | tokio::io::AsyncWriteExt::write_f64(&mut BoxAsyncWrite, f64): Send & Sync & !Unpin |
676 | ); |
677 | async_assert_fn!( |
678 | tokio::io::AsyncWriteExt::write_u16_le(&mut BoxAsyncWrite, u16): Send & Sync & !Unpin |
679 | ); |
680 | async_assert_fn!( |
681 | tokio::io::AsyncWriteExt::write_i16_le(&mut BoxAsyncWrite, i16): Send & Sync & !Unpin |
682 | ); |
683 | async_assert_fn!( |
684 | tokio::io::AsyncWriteExt::write_u32_le(&mut BoxAsyncWrite, u32): Send & Sync & !Unpin |
685 | ); |
686 | async_assert_fn!( |
687 | tokio::io::AsyncWriteExt::write_i32_le(&mut BoxAsyncWrite, i32): Send & Sync & !Unpin |
688 | ); |
689 | async_assert_fn!( |
690 | tokio::io::AsyncWriteExt::write_u64_le(&mut BoxAsyncWrite, u64): Send & Sync & !Unpin |
691 | ); |
692 | async_assert_fn!( |
693 | tokio::io::AsyncWriteExt::write_i64_le(&mut BoxAsyncWrite, i64): Send & Sync & !Unpin |
694 | ); |
695 | async_assert_fn!( |
696 | tokio::io::AsyncWriteExt::write_u128_le(&mut BoxAsyncWrite, u128): Send & Sync & !Unpin |
697 | ); |
698 | async_assert_fn!( |
699 | tokio::io::AsyncWriteExt::write_i128_le(&mut BoxAsyncWrite, i128): Send & Sync & !Unpin |
700 | ); |
701 | async_assert_fn!( |
702 | tokio::io::AsyncWriteExt::write_f32_le(&mut BoxAsyncWrite, f32): Send & Sync & !Unpin |
703 | ); |
704 | async_assert_fn!( |
705 | tokio::io::AsyncWriteExt::write_f64_le(&mut BoxAsyncWrite, f64): Send & Sync & !Unpin |
706 | ); |
707 | async_assert_fn!(tokio::io::AsyncWriteExt::flush(&mut BoxAsyncWrite): Send & Sync & !Unpin); |
708 | async_assert_fn!(tokio::io::AsyncWriteExt::shutdown(&mut BoxAsyncWrite): Send & Sync & !Unpin); |
709 | |
710 | #[cfg (unix)] |
711 | mod 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 | |