mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-06 00:00:10 +02:00
Merge branch 'master' into ci-beta-1.87
This commit is contained in:
@@ -1,3 +1,21 @@
|
|||||||
|
# 0.7.15 (April 23rd, 2025)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- task: properly handle removed entries in `JoinMap` ([#7264])
|
||||||
|
|
||||||
|
### Updated
|
||||||
|
|
||||||
|
- deps: update hashbrown to 0.15 ([#7219])
|
||||||
|
|
||||||
|
### Documented
|
||||||
|
|
||||||
|
- task: explicitly state that `TaskTracker` does not abort tasks on Drop ([#7223])
|
||||||
|
|
||||||
|
[#7219]: https://github.com/tokio-rs/tokio/pull/7219
|
||||||
|
[#7223]: https://github.com/tokio-rs/tokio/pull/7223
|
||||||
|
[#7264]: https://github.com/tokio-rs/tokio/pull/7264
|
||||||
|
|
||||||
# 0.7.14 (March 12th, 2025)
|
# 0.7.14 (March 12th, 2025)
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ name = "tokio-util"
|
|||||||
# - Remove path dependencies
|
# - Remove path dependencies
|
||||||
# - Update CHANGELOG.md.
|
# - Update CHANGELOG.md.
|
||||||
# - Create "tokio-util-0.7.x" git tag.
|
# - Create "tokio-util-0.7.x" git tag.
|
||||||
version = "0.7.14"
|
version = "0.7.15"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.70"
|
rust-version = "1.70"
|
||||||
authors = ["Tokio Contributors <[email protected]>"]
|
authors = ["Tokio Contributors <[email protected]>"]
|
||||||
|
|||||||
+1
-1
@@ -131,7 +131,7 @@ features = [
|
|||||||
tokio-test = { version = "0.4.0", path = "../tokio-test" }
|
tokio-test = { version = "0.4.0", path = "../tokio-test" }
|
||||||
tokio-stream = { version = "0.1", path = "../tokio-stream" }
|
tokio-stream = { version = "0.1", path = "../tokio-stream" }
|
||||||
futures = { version = "0.3.0", features = ["async-await"] }
|
futures = { version = "0.3.0", features = ["async-await"] }
|
||||||
mockall = "0.11.1"
|
mockall = "0.13.0"
|
||||||
async-stream = "0.3"
|
async-stream = "0.3"
|
||||||
futures-concurrency = "7.6.3"
|
futures-concurrency = "7.6.3"
|
||||||
|
|
||||||
|
|||||||
@@ -62,6 +62,13 @@ impl Read for MockFile {
|
|||||||
|
|
||||||
impl Read for &'_ MockFile {
|
impl Read for &'_ MockFile {
|
||||||
fn read(&mut self, dst: &mut [u8]) -> io::Result<usize> {
|
fn read(&mut self, dst: &mut [u8]) -> io::Result<usize> {
|
||||||
|
// Placate Miri. Tokio will call this method with an uninitialized
|
||||||
|
// buffer, which is ok because std::io::Read::read implementations don't usually read
|
||||||
|
// from their input buffers. But Mockall 0.12-0.13 will try to Debug::fmt the
|
||||||
|
// buffer, even if there is no failure, triggering an uninitialized data access alert from
|
||||||
|
// Miri. Initialize the data here just to prevent those Miri alerts.
|
||||||
|
// This can be removed after upgrading to Mockall 0.14.
|
||||||
|
dst.fill(0);
|
||||||
self.inner_read(dst)
|
self.inner_read(dst)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,13 +84,12 @@ impl TcpListener {
|
|||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```no_run
|
/// ```no_run
|
||||||
/// # if cfg!(miri) { return } // No `socket` in miri.
|
|
||||||
/// use tokio::net::TcpListener;
|
/// use tokio::net::TcpListener;
|
||||||
///
|
|
||||||
/// use std::io;
|
/// use std::io;
|
||||||
///
|
///
|
||||||
/// #[tokio::main]
|
/// #[tokio::main]
|
||||||
/// async fn main() -> io::Result<()> {
|
/// async fn main() -> io::Result<()> {
|
||||||
|
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
|
||||||
/// let listener = TcpListener::bind("127.0.0.1:2345").await?;
|
/// let listener = TcpListener::bind("127.0.0.1:2345").await?;
|
||||||
///
|
///
|
||||||
/// // use the listener
|
/// // use the listener
|
||||||
|
|||||||
@@ -743,12 +743,12 @@ impl TcpSocket {
|
|||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// # if cfg!(miri) { return } // No `socket` in miri.
|
|
||||||
/// use tokio::net::TcpSocket;
|
/// use tokio::net::TcpSocket;
|
||||||
/// use socket2::{Domain, Socket, Type};
|
/// use socket2::{Domain, Socket, Type};
|
||||||
///
|
///
|
||||||
/// #[tokio::main]
|
/// #[tokio::main]
|
||||||
/// async fn main() -> std::io::Result<()> {
|
/// async fn main() -> std::io::Result<()> {
|
||||||
|
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
|
||||||
/// let socket2_socket = Socket::new(Domain::IPV4, Type::STREAM, None)?;
|
/// let socket2_socket = Socket::new(Domain::IPV4, Type::STREAM, None)?;
|
||||||
/// socket2_socket.set_nonblocking(true)?;
|
/// socket2_socket.set_nonblocking(true)?;
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -220,7 +220,6 @@ impl TcpStream {
|
|||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// # if cfg!(miri) { return } // No `socket` in miri.
|
|
||||||
/// use std::error::Error;
|
/// use std::error::Error;
|
||||||
/// use std::io::Read;
|
/// use std::io::Read;
|
||||||
/// use tokio::net::TcpListener;
|
/// use tokio::net::TcpListener;
|
||||||
@@ -229,6 +228,7 @@ impl TcpStream {
|
|||||||
///
|
///
|
||||||
/// #[tokio::main]
|
/// #[tokio::main]
|
||||||
/// async fn main() -> Result<(), Box<dyn Error>> {
|
/// async fn main() -> Result<(), Box<dyn Error>> {
|
||||||
|
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
|
||||||
/// let mut data = [0u8; 12];
|
/// let mut data = [0u8; 12];
|
||||||
/// # if false {
|
/// # if false {
|
||||||
/// let listener = TcpListener::bind("127.0.0.1:34254").await?;
|
/// let listener = TcpListener::bind("127.0.0.1:34254").await?;
|
||||||
|
|||||||
@@ -135,12 +135,12 @@ impl UdpSocket {
|
|||||||
/// # Example
|
/// # Example
|
||||||
///
|
///
|
||||||
/// ```no_run
|
/// ```no_run
|
||||||
/// # if cfg!(miri) { return } // No `socket` in miri.
|
|
||||||
/// use tokio::net::UdpSocket;
|
/// use tokio::net::UdpSocket;
|
||||||
/// use std::io;
|
/// use std::io;
|
||||||
///
|
///
|
||||||
/// #[tokio::main]
|
/// #[tokio::main]
|
||||||
/// async fn main() -> io::Result<()> {
|
/// async fn main() -> io::Result<()> {
|
||||||
|
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
|
||||||
/// let sock = UdpSocket::bind("0.0.0.0:8080").await?;
|
/// let sock = UdpSocket::bind("0.0.0.0:8080").await?;
|
||||||
/// // use `sock`
|
/// // use `sock`
|
||||||
/// # let _ = sock;
|
/// # let _ = sock;
|
||||||
@@ -303,12 +303,12 @@ impl UdpSocket {
|
|||||||
/// # Example
|
/// # Example
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// # if cfg!(miri) { return } // No `socket` in miri.
|
|
||||||
/// use tokio::net::UdpSocket;
|
/// use tokio::net::UdpSocket;
|
||||||
///
|
///
|
||||||
/// # use std::{io, net::SocketAddr};
|
/// # use std::{io, net::SocketAddr};
|
||||||
/// # #[tokio::main]
|
/// # #[tokio::main]
|
||||||
/// # async fn main() -> io::Result<()> {
|
/// # async fn main() -> io::Result<()> {
|
||||||
|
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
|
||||||
/// let addr = "0.0.0.0:8080".parse::<SocketAddr>().unwrap();
|
/// let addr = "0.0.0.0:8080".parse::<SocketAddr>().unwrap();
|
||||||
/// let peer = "127.0.0.1:11100".parse::<SocketAddr>().unwrap();
|
/// let peer = "127.0.0.1:11100".parse::<SocketAddr>().unwrap();
|
||||||
/// let sock = UdpSocket::bind(addr).await?;
|
/// let sock = UdpSocket::bind(addr).await?;
|
||||||
@@ -2130,12 +2130,12 @@ impl UdpSocket {
|
|||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
/// ```
|
/// ```
|
||||||
/// # if cfg!(miri) { return } // No `socket` in miri.
|
|
||||||
/// use tokio::net::UdpSocket;
|
/// use tokio::net::UdpSocket;
|
||||||
/// use std::io;
|
/// use std::io;
|
||||||
///
|
///
|
||||||
/// #[tokio::main]
|
/// #[tokio::main]
|
||||||
/// async fn main() -> io::Result<()> {
|
/// async fn main() -> io::Result<()> {
|
||||||
|
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
|
||||||
/// // Create a socket
|
/// // Create a socket
|
||||||
/// let socket = UdpSocket::bind("0.0.0.0:8080").await?;
|
/// let socket = UdpSocket::bind("0.0.0.0:8080").await?;
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -36,10 +36,10 @@ cfg_net_unix! {
|
|||||||
/// # Examples
|
/// # Examples
|
||||||
/// Using named sockets, associated with a filesystem path:
|
/// Using named sockets, associated with a filesystem path:
|
||||||
/// ```
|
/// ```
|
||||||
/// # if cfg!(miri) { return } // No `socket` in miri.
|
|
||||||
/// # use std::error::Error;
|
/// # use std::error::Error;
|
||||||
/// # #[tokio::main]
|
/// # #[tokio::main]
|
||||||
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
||||||
|
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
|
||||||
/// use tokio::net::UnixDatagram;
|
/// use tokio::net::UnixDatagram;
|
||||||
/// use tempfile::tempdir;
|
/// use tempfile::tempdir;
|
||||||
///
|
///
|
||||||
@@ -69,10 +69,10 @@ cfg_net_unix! {
|
|||||||
///
|
///
|
||||||
/// Using unnamed sockets, created as a pair
|
/// Using unnamed sockets, created as a pair
|
||||||
/// ```
|
/// ```
|
||||||
/// # if cfg!(miri) { return } // No SOCK_DGRAM for `socketpair` in miri.
|
|
||||||
/// # use std::error::Error;
|
/// # use std::error::Error;
|
||||||
/// # #[tokio::main]
|
/// # #[tokio::main]
|
||||||
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
||||||
|
/// # if cfg!(miri) { return Ok(()); } // No SOCK_DGRAM for `socketpair` in miri.
|
||||||
/// use tokio::net::UnixDatagram;
|
/// use tokio::net::UnixDatagram;
|
||||||
///
|
///
|
||||||
/// // Create the pair of sockets
|
/// // Create the pair of sockets
|
||||||
@@ -374,10 +374,10 @@ impl UnixDatagram {
|
|||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
/// ```
|
/// ```
|
||||||
/// # if cfg!(miri) { return } // No `socket` in miri.
|
|
||||||
/// # use std::error::Error;
|
/// # use std::error::Error;
|
||||||
/// # #[tokio::main]
|
/// # #[tokio::main]
|
||||||
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
||||||
|
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
|
||||||
/// use tokio::net::UnixDatagram;
|
/// use tokio::net::UnixDatagram;
|
||||||
/// use tempfile::tempdir;
|
/// use tempfile::tempdir;
|
||||||
///
|
///
|
||||||
@@ -407,10 +407,10 @@ impl UnixDatagram {
|
|||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
/// ```
|
/// ```
|
||||||
/// # if cfg!(miri) { return } // No SOCK_DGRAM for `socketpair` in miri.
|
|
||||||
/// # use std::error::Error;
|
/// # use std::error::Error;
|
||||||
/// # #[tokio::main]
|
/// # #[tokio::main]
|
||||||
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
||||||
|
/// # if cfg!(miri) { return Ok(()); } // No SOCK_DGRAM for `socketpair` in miri.
|
||||||
/// use tokio::net::UnixDatagram;
|
/// use tokio::net::UnixDatagram;
|
||||||
///
|
///
|
||||||
/// // Create the pair of sockets
|
/// // Create the pair of sockets
|
||||||
@@ -466,10 +466,10 @@ impl UnixDatagram {
|
|||||||
/// explicitly with [`Runtime::enter`](crate::runtime::Runtime::enter) function.
|
/// explicitly with [`Runtime::enter`](crate::runtime::Runtime::enter) function.
|
||||||
/// # Examples
|
/// # Examples
|
||||||
/// ```
|
/// ```
|
||||||
/// # if cfg!(miri) { return } // No `socket` in miri.
|
|
||||||
/// # use std::error::Error;
|
/// # use std::error::Error;
|
||||||
/// # #[tokio::main]
|
/// # #[tokio::main]
|
||||||
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
||||||
|
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
|
||||||
/// use tokio::net::UnixDatagram;
|
/// use tokio::net::UnixDatagram;
|
||||||
/// use std::os::unix::net::UnixDatagram as StdUDS;
|
/// use std::os::unix::net::UnixDatagram as StdUDS;
|
||||||
/// use tempfile::tempdir;
|
/// use tempfile::tempdir;
|
||||||
@@ -533,10 +533,10 @@ impl UnixDatagram {
|
|||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
/// ```
|
/// ```
|
||||||
/// # if cfg!(miri) { return } // No `socket` in miri.
|
|
||||||
/// # use std::error::Error;
|
/// # use std::error::Error;
|
||||||
/// # #[tokio::main]
|
/// # #[tokio::main]
|
||||||
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
||||||
|
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
|
||||||
/// use tokio::net::UnixDatagram;
|
/// use tokio::net::UnixDatagram;
|
||||||
/// use tempfile::tempdir;
|
/// use tempfile::tempdir;
|
||||||
///
|
///
|
||||||
@@ -573,10 +573,10 @@ impl UnixDatagram {
|
|||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
/// ```
|
/// ```
|
||||||
/// # if cfg!(miri) { return } // No `socket` in miri.
|
|
||||||
/// # use std::error::Error;
|
/// # use std::error::Error;
|
||||||
/// # #[tokio::main]
|
/// # #[tokio::main]
|
||||||
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
||||||
|
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
|
||||||
/// use tokio::net::UnixDatagram;
|
/// use tokio::net::UnixDatagram;
|
||||||
/// use tempfile::tempdir;
|
/// use tempfile::tempdir;
|
||||||
///
|
///
|
||||||
@@ -618,10 +618,10 @@ impl UnixDatagram {
|
|||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
/// ```
|
/// ```
|
||||||
/// # if cfg!(miri) { return } // No SOCK_DGRAM for `socketpair` in miri.
|
|
||||||
/// # use std::error::Error;
|
/// # use std::error::Error;
|
||||||
/// # #[tokio::main]
|
/// # #[tokio::main]
|
||||||
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
||||||
|
/// # if cfg!(miri) { return Ok(()); } // No SOCK_DGRAM for `socketpair` in miri.
|
||||||
/// use tokio::net::UnixDatagram;
|
/// use tokio::net::UnixDatagram;
|
||||||
///
|
///
|
||||||
/// // Create the pair of sockets
|
/// // Create the pair of sockets
|
||||||
@@ -749,10 +749,10 @@ impl UnixDatagram {
|
|||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
/// ```
|
/// ```
|
||||||
/// # if cfg!(miri) { return } // No SOCK_DGRAM for `socketpair` in miri.
|
|
||||||
/// # use std::error::Error;
|
/// # use std::error::Error;
|
||||||
/// # #[tokio::main]
|
/// # #[tokio::main]
|
||||||
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
||||||
|
/// # if cfg!(miri) { return Ok(()); } // No SOCK_DGRAM for `socketpair` in miri.
|
||||||
/// use tokio::net::UnixDatagram;
|
/// use tokio::net::UnixDatagram;
|
||||||
///
|
///
|
||||||
/// // Create the pair of sockets
|
/// // Create the pair of sockets
|
||||||
@@ -900,10 +900,10 @@ impl UnixDatagram {
|
|||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
/// ```
|
/// ```
|
||||||
/// # if cfg!(miri) { return } // No `socket` in miri.
|
|
||||||
/// # use std::error::Error;
|
/// # use std::error::Error;
|
||||||
/// # #[tokio::main]
|
/// # #[tokio::main]
|
||||||
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
||||||
|
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
|
||||||
/// use tokio::net::UnixDatagram;
|
/// use tokio::net::UnixDatagram;
|
||||||
/// use tempfile::tempdir;
|
/// use tempfile::tempdir;
|
||||||
///
|
///
|
||||||
@@ -1017,10 +1017,10 @@ impl UnixDatagram {
|
|||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
/// ```
|
/// ```
|
||||||
/// # if cfg!(miri) { return } // No SOCK_DGRAM for `socketpair` in miri.
|
|
||||||
/// # use std::error::Error;
|
/// # use std::error::Error;
|
||||||
/// # #[tokio::main]
|
/// # #[tokio::main]
|
||||||
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
||||||
|
/// # if cfg!(miri) { return Ok(()); } // No SOCK_DGRAM for `socketpair` in miri.
|
||||||
/// use tokio::net::UnixDatagram;
|
/// use tokio::net::UnixDatagram;
|
||||||
///
|
///
|
||||||
/// // Create the pair of sockets
|
/// // Create the pair of sockets
|
||||||
@@ -1068,10 +1068,10 @@ impl UnixDatagram {
|
|||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
/// ```
|
/// ```
|
||||||
/// # if cfg!(miri) { return } // No `socket` in miri.
|
|
||||||
/// # use std::error::Error;
|
/// # use std::error::Error;
|
||||||
/// # #[tokio::main]
|
/// # #[tokio::main]
|
||||||
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
||||||
|
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
|
||||||
/// use tokio::net::UnixDatagram;
|
/// use tokio::net::UnixDatagram;
|
||||||
/// use tempfile::tempdir;
|
/// use tempfile::tempdir;
|
||||||
///
|
///
|
||||||
@@ -1119,10 +1119,10 @@ impl UnixDatagram {
|
|||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
/// ```
|
/// ```
|
||||||
/// # if cfg!(miri) { return } // No `socket` in miri.
|
|
||||||
/// # use std::error::Error;
|
/// # use std::error::Error;
|
||||||
/// # #[tokio::main]
|
/// # #[tokio::main]
|
||||||
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
||||||
|
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
|
||||||
/// use tokio::net::UnixDatagram;
|
/// use tokio::net::UnixDatagram;
|
||||||
/// use tempfile::tempdir;
|
/// use tempfile::tempdir;
|
||||||
///
|
///
|
||||||
@@ -1436,10 +1436,10 @@ impl UnixDatagram {
|
|||||||
/// # Examples
|
/// # Examples
|
||||||
/// For a socket bound to a local path
|
/// For a socket bound to a local path
|
||||||
/// ```
|
/// ```
|
||||||
/// # if cfg!(miri) { return } // No `socket` in miri.
|
|
||||||
/// # use std::error::Error;
|
/// # use std::error::Error;
|
||||||
/// # #[tokio::main]
|
/// # #[tokio::main]
|
||||||
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
||||||
|
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
|
||||||
/// use tokio::net::UnixDatagram;
|
/// use tokio::net::UnixDatagram;
|
||||||
/// use tempfile::tempdir;
|
/// use tempfile::tempdir;
|
||||||
///
|
///
|
||||||
@@ -1459,10 +1459,10 @@ impl UnixDatagram {
|
|||||||
///
|
///
|
||||||
/// For an unbound socket
|
/// For an unbound socket
|
||||||
/// ```
|
/// ```
|
||||||
/// # if cfg!(miri) { return } // No `socket` in miri.
|
|
||||||
/// # use std::error::Error;
|
/// # use std::error::Error;
|
||||||
/// # #[tokio::main]
|
/// # #[tokio::main]
|
||||||
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
||||||
|
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
|
||||||
/// use tokio::net::UnixDatagram;
|
/// use tokio::net::UnixDatagram;
|
||||||
///
|
///
|
||||||
/// // Create an unbound socket
|
/// // Create an unbound socket
|
||||||
@@ -1484,10 +1484,10 @@ impl UnixDatagram {
|
|||||||
/// # Examples
|
/// # Examples
|
||||||
/// For a peer with a local path
|
/// For a peer with a local path
|
||||||
/// ```
|
/// ```
|
||||||
/// # if cfg!(miri) { return } // No `socket` in miri.
|
|
||||||
/// # use std::error::Error;
|
/// # use std::error::Error;
|
||||||
/// # #[tokio::main]
|
/// # #[tokio::main]
|
||||||
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
||||||
|
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
|
||||||
/// use tokio::net::UnixDatagram;
|
/// use tokio::net::UnixDatagram;
|
||||||
/// use tempfile::tempdir;
|
/// use tempfile::tempdir;
|
||||||
///
|
///
|
||||||
@@ -1510,10 +1510,10 @@ impl UnixDatagram {
|
|||||||
///
|
///
|
||||||
/// For an unbound peer
|
/// For an unbound peer
|
||||||
/// ```
|
/// ```
|
||||||
/// # if cfg!(miri) { return } // No SOCK_DGRAM for `socketpair` in miri.
|
|
||||||
/// # use std::error::Error;
|
/// # use std::error::Error;
|
||||||
/// # #[tokio::main]
|
/// # #[tokio::main]
|
||||||
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
||||||
|
/// # if cfg!(miri) { return Ok(()); } // No SOCK_DGRAM for `socketpair` in miri.
|
||||||
/// use tokio::net::UnixDatagram;
|
/// use tokio::net::UnixDatagram;
|
||||||
///
|
///
|
||||||
/// // Create the pair of sockets
|
/// // Create the pair of sockets
|
||||||
@@ -1532,10 +1532,10 @@ impl UnixDatagram {
|
|||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
/// ```
|
/// ```
|
||||||
/// # if cfg!(miri) { return } // No `socket` in miri.
|
|
||||||
/// # use std::error::Error;
|
/// # use std::error::Error;
|
||||||
/// # #[tokio::main]
|
/// # #[tokio::main]
|
||||||
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
||||||
|
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
|
||||||
/// use tokio::net::UnixDatagram;
|
/// use tokio::net::UnixDatagram;
|
||||||
///
|
///
|
||||||
/// // Create an unbound socket
|
/// // Create an unbound socket
|
||||||
@@ -1560,10 +1560,10 @@ impl UnixDatagram {
|
|||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
/// ```
|
/// ```
|
||||||
/// # if cfg!(miri) { return } // No SOCK_DGRAM for `socketpair` in miri.
|
|
||||||
/// # use std::error::Error;
|
/// # use std::error::Error;
|
||||||
/// # #[tokio::main]
|
/// # #[tokio::main]
|
||||||
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
/// # async fn main() -> Result<(), Box<dyn Error>> {
|
||||||
|
/// # if cfg!(miri) { return Ok(()); } // No SOCK_DGRAM for `socketpair` in miri.
|
||||||
/// use tokio::net::UnixDatagram;
|
/// use tokio::net::UnixDatagram;
|
||||||
/// use std::net::Shutdown;
|
/// use std::net::Shutdown;
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -840,7 +840,6 @@ impl UnixStream {
|
|||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// # if cfg!(miri) { return } // No `socket` in miri.
|
|
||||||
/// use std::error::Error;
|
/// use std::error::Error;
|
||||||
/// use std::io::Read;
|
/// use std::io::Read;
|
||||||
/// use tokio::net::UnixListener;
|
/// use tokio::net::UnixListener;
|
||||||
@@ -849,6 +848,7 @@ impl UnixStream {
|
|||||||
///
|
///
|
||||||
/// #[tokio::main]
|
/// #[tokio::main]
|
||||||
/// async fn main() -> Result<(), Box<dyn Error>> {
|
/// async fn main() -> Result<(), Box<dyn Error>> {
|
||||||
|
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
|
||||||
/// let dir = tempfile::tempdir().unwrap();
|
/// let dir = tempfile::tempdir().unwrap();
|
||||||
/// let bind_path = dir.path().join("bind_path");
|
/// let bind_path = dir.path().join("bind_path");
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -810,7 +810,6 @@ impl Command {
|
|||||||
/// Basic usage:
|
/// Basic usage:
|
||||||
///
|
///
|
||||||
/// ```no_run
|
/// ```no_run
|
||||||
/// # if cfg!(miri) { return } // No `pidfd_spawnp` in miri.
|
|
||||||
/// use tokio::process::Command;
|
/// use tokio::process::Command;
|
||||||
///
|
///
|
||||||
/// async fn run_ls() -> std::process::ExitStatus {
|
/// async fn run_ls() -> std::process::ExitStatus {
|
||||||
@@ -1347,7 +1346,6 @@ impl Child {
|
|||||||
/// This function is cancel safe.
|
/// This function is cancel safe.
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// # if cfg!(miri) { return } // No `pidfd_spawnp` in miri.
|
|
||||||
/// # #[cfg(not(unix))]fn main(){}
|
/// # #[cfg(not(unix))]fn main(){}
|
||||||
/// # #[cfg(unix)]
|
/// # #[cfg(unix)]
|
||||||
/// use tokio::io::AsyncWriteExt;
|
/// use tokio::io::AsyncWriteExt;
|
||||||
@@ -1359,6 +1357,7 @@ impl Child {
|
|||||||
/// # #[cfg(unix)]
|
/// # #[cfg(unix)]
|
||||||
/// #[tokio::main]
|
/// #[tokio::main]
|
||||||
/// async fn main() {
|
/// async fn main() {
|
||||||
|
/// # if cfg!(miri) { return; } // No `pidfd_spawnp` in miri.
|
||||||
/// let mut child = Command::new("cat")
|
/// let mut child = Command::new("cat")
|
||||||
/// .stdin(Stdio::piped())
|
/// .stdin(Stdio::piped())
|
||||||
/// .spawn()
|
/// .spawn()
|
||||||
|
|||||||
@@ -407,7 +407,6 @@ impl Runtime {
|
|||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// # if cfg!(miri) { return } // Miri reports error when main thread terminated without waiting all remaining threads.
|
|
||||||
/// use tokio::runtime::Runtime;
|
/// use tokio::runtime::Runtime;
|
||||||
/// use tokio::task;
|
/// use tokio::task;
|
||||||
///
|
///
|
||||||
@@ -415,6 +414,7 @@ impl Runtime {
|
|||||||
/// use std::time::Duration;
|
/// use std::time::Duration;
|
||||||
///
|
///
|
||||||
/// fn main() {
|
/// fn main() {
|
||||||
|
/// # if cfg!(miri) { return } // Miri reports error when main thread terminated without waiting all remaining threads.
|
||||||
/// let runtime = Runtime::new().unwrap();
|
/// let runtime = Runtime::new().unwrap();
|
||||||
///
|
///
|
||||||
/// runtime.block_on(async move {
|
/// runtime.block_on(async move {
|
||||||
|
|||||||
Reference in New Issue
Block a user