Merge branch 'master' into ci-beta-1.87

This commit is contained in:
Alice Ryhl
2025-04-24 14:50:34 +02:00
committed by GitHub
12 changed files with 55 additions and 32 deletions
+18
View File
@@ -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)
### Added
+1 -1
View File
@@ -4,7 +4,7 @@ name = "tokio-util"
# - Remove path dependencies
# - Update CHANGELOG.md.
# - Create "tokio-util-0.7.x" git tag.
version = "0.7.14"
version = "0.7.15"
edition = "2021"
rust-version = "1.70"
authors = ["Tokio Contributors <[email protected]>"]
+1 -1
View File
@@ -131,7 +131,7 @@ features = [
tokio-test = { version = "0.4.0", path = "../tokio-test" }
tokio-stream = { version = "0.1", path = "../tokio-stream" }
futures = { version = "0.3.0", features = ["async-await"] }
mockall = "0.11.1"
mockall = "0.13.0"
async-stream = "0.3"
futures-concurrency = "7.6.3"
+7
View File
@@ -62,6 +62,13 @@ impl Read for MockFile {
impl Read for &'_ MockFile {
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)
}
}
+1 -2
View File
@@ -84,13 +84,12 @@ impl TcpListener {
/// # Examples
///
/// ```no_run
/// # if cfg!(miri) { return } // No `socket` in miri.
/// use tokio::net::TcpListener;
///
/// use std::io;
///
/// #[tokio::main]
/// async fn main() -> io::Result<()> {
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
/// let listener = TcpListener::bind("127.0.0.1:2345").await?;
///
/// // use the listener
+1 -1
View File
@@ -743,12 +743,12 @@ impl TcpSocket {
/// # Examples
///
/// ```
/// # if cfg!(miri) { return } // No `socket` in miri.
/// use tokio::net::TcpSocket;
/// use socket2::{Domain, Socket, Type};
///
/// #[tokio::main]
/// 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)?;
/// socket2_socket.set_nonblocking(true)?;
///
+1 -1
View File
@@ -220,7 +220,6 @@ impl TcpStream {
/// # Examples
///
/// ```
/// # if cfg!(miri) { return } // No `socket` in miri.
/// use std::error::Error;
/// use std::io::Read;
/// use tokio::net::TcpListener;
@@ -229,6 +228,7 @@ impl TcpStream {
///
/// #[tokio::main]
/// async fn main() -> Result<(), Box<dyn Error>> {
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
/// let mut data = [0u8; 12];
/// # if false {
/// let listener = TcpListener::bind("127.0.0.1:34254").await?;
+3 -3
View File
@@ -135,12 +135,12 @@ impl UdpSocket {
/// # Example
///
/// ```no_run
/// # if cfg!(miri) { return } // No `socket` in miri.
/// use tokio::net::UdpSocket;
/// use std::io;
///
/// #[tokio::main]
/// async fn main() -> io::Result<()> {
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
/// let sock = UdpSocket::bind("0.0.0.0:8080").await?;
/// // use `sock`
/// # let _ = sock;
@@ -303,12 +303,12 @@ impl UdpSocket {
/// # Example
///
/// ```
/// # if cfg!(miri) { return } // No `socket` in miri.
/// use tokio::net::UdpSocket;
///
/// # use std::{io, net::SocketAddr};
/// # #[tokio::main]
/// # 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 peer = "127.0.0.1:11100".parse::<SocketAddr>().unwrap();
/// let sock = UdpSocket::bind(addr).await?;
@@ -2130,12 +2130,12 @@ impl UdpSocket {
///
/// # Examples
/// ```
/// # if cfg!(miri) { return } // No `socket` in miri.
/// use tokio::net::UdpSocket;
/// use std::io;
///
/// #[tokio::main]
/// async fn main() -> io::Result<()> {
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
/// // Create a socket
/// let socket = UdpSocket::bind("0.0.0.0:8080").await?;
///
+19 -19
View File
@@ -36,10 +36,10 @@ cfg_net_unix! {
/// # Examples
/// Using named sockets, associated with a filesystem path:
/// ```
/// # if cfg!(miri) { return } // No `socket` in miri.
/// # use std::error::Error;
/// # #[tokio::main]
/// # async fn main() -> Result<(), Box<dyn Error>> {
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
/// use tokio::net::UnixDatagram;
/// use tempfile::tempdir;
///
@@ -69,10 +69,10 @@ cfg_net_unix! {
///
/// Using unnamed sockets, created as a pair
/// ```
/// # if cfg!(miri) { return } // No SOCK_DGRAM for `socketpair` in miri.
/// # use std::error::Error;
/// # #[tokio::main]
/// # async fn main() -> Result<(), Box<dyn Error>> {
/// # if cfg!(miri) { return Ok(()); } // No SOCK_DGRAM for `socketpair` in miri.
/// use tokio::net::UnixDatagram;
///
/// // Create the pair of sockets
@@ -374,10 +374,10 @@ impl UnixDatagram {
///
/// # Examples
/// ```
/// # if cfg!(miri) { return } // No `socket` in miri.
/// # use std::error::Error;
/// # #[tokio::main]
/// # async fn main() -> Result<(), Box<dyn Error>> {
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
/// use tokio::net::UnixDatagram;
/// use tempfile::tempdir;
///
@@ -407,10 +407,10 @@ impl UnixDatagram {
///
/// # Examples
/// ```
/// # if cfg!(miri) { return } // No SOCK_DGRAM for `socketpair` in miri.
/// # use std::error::Error;
/// # #[tokio::main]
/// # async fn main() -> Result<(), Box<dyn Error>> {
/// # if cfg!(miri) { return Ok(()); } // No SOCK_DGRAM for `socketpair` in miri.
/// use tokio::net::UnixDatagram;
///
/// // Create the pair of sockets
@@ -466,10 +466,10 @@ impl UnixDatagram {
/// explicitly with [`Runtime::enter`](crate::runtime::Runtime::enter) function.
/// # Examples
/// ```
/// # if cfg!(miri) { return } // No `socket` in miri.
/// # use std::error::Error;
/// # #[tokio::main]
/// # async fn main() -> Result<(), Box<dyn Error>> {
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
/// use tokio::net::UnixDatagram;
/// use std::os::unix::net::UnixDatagram as StdUDS;
/// use tempfile::tempdir;
@@ -533,10 +533,10 @@ impl UnixDatagram {
///
/// # Examples
/// ```
/// # if cfg!(miri) { return } // No `socket` in miri.
/// # use std::error::Error;
/// # #[tokio::main]
/// # async fn main() -> Result<(), Box<dyn Error>> {
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
/// use tokio::net::UnixDatagram;
/// use tempfile::tempdir;
///
@@ -573,10 +573,10 @@ impl UnixDatagram {
///
/// # Examples
/// ```
/// # if cfg!(miri) { return } // No `socket` in miri.
/// # use std::error::Error;
/// # #[tokio::main]
/// # async fn main() -> Result<(), Box<dyn Error>> {
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
/// use tokio::net::UnixDatagram;
/// use tempfile::tempdir;
///
@@ -618,10 +618,10 @@ impl UnixDatagram {
///
/// # Examples
/// ```
/// # if cfg!(miri) { return } // No SOCK_DGRAM for `socketpair` in miri.
/// # use std::error::Error;
/// # #[tokio::main]
/// # async fn main() -> Result<(), Box<dyn Error>> {
/// # if cfg!(miri) { return Ok(()); } // No SOCK_DGRAM for `socketpair` in miri.
/// use tokio::net::UnixDatagram;
///
/// // Create the pair of sockets
@@ -749,10 +749,10 @@ impl UnixDatagram {
///
/// # Examples
/// ```
/// # if cfg!(miri) { return } // No SOCK_DGRAM for `socketpair` in miri.
/// # use std::error::Error;
/// # #[tokio::main]
/// # async fn main() -> Result<(), Box<dyn Error>> {
/// # if cfg!(miri) { return Ok(()); } // No SOCK_DGRAM for `socketpair` in miri.
/// use tokio::net::UnixDatagram;
///
/// // Create the pair of sockets
@@ -900,10 +900,10 @@ impl UnixDatagram {
///
/// # Examples
/// ```
/// # if cfg!(miri) { return } // No `socket` in miri.
/// # use std::error::Error;
/// # #[tokio::main]
/// # async fn main() -> Result<(), Box<dyn Error>> {
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
/// use tokio::net::UnixDatagram;
/// use tempfile::tempdir;
///
@@ -1017,10 +1017,10 @@ impl UnixDatagram {
///
/// # Examples
/// ```
/// # if cfg!(miri) { return } // No SOCK_DGRAM for `socketpair` in miri.
/// # use std::error::Error;
/// # #[tokio::main]
/// # async fn main() -> Result<(), Box<dyn Error>> {
/// # if cfg!(miri) { return Ok(()); } // No SOCK_DGRAM for `socketpair` in miri.
/// use tokio::net::UnixDatagram;
///
/// // Create the pair of sockets
@@ -1068,10 +1068,10 @@ impl UnixDatagram {
///
/// # Examples
/// ```
/// # if cfg!(miri) { return } // No `socket` in miri.
/// # use std::error::Error;
/// # #[tokio::main]
/// # async fn main() -> Result<(), Box<dyn Error>> {
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
/// use tokio::net::UnixDatagram;
/// use tempfile::tempdir;
///
@@ -1119,10 +1119,10 @@ impl UnixDatagram {
///
/// # Examples
/// ```
/// # if cfg!(miri) { return } // No `socket` in miri.
/// # use std::error::Error;
/// # #[tokio::main]
/// # async fn main() -> Result<(), Box<dyn Error>> {
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
/// use tokio::net::UnixDatagram;
/// use tempfile::tempdir;
///
@@ -1436,10 +1436,10 @@ impl UnixDatagram {
/// # Examples
/// For a socket bound to a local path
/// ```
/// # if cfg!(miri) { return } // No `socket` in miri.
/// # use std::error::Error;
/// # #[tokio::main]
/// # async fn main() -> Result<(), Box<dyn Error>> {
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
/// use tokio::net::UnixDatagram;
/// use tempfile::tempdir;
///
@@ -1459,10 +1459,10 @@ impl UnixDatagram {
///
/// For an unbound socket
/// ```
/// # if cfg!(miri) { return } // No `socket` in miri.
/// # use std::error::Error;
/// # #[tokio::main]
/// # async fn main() -> Result<(), Box<dyn Error>> {
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
/// use tokio::net::UnixDatagram;
///
/// // Create an unbound socket
@@ -1484,10 +1484,10 @@ impl UnixDatagram {
/// # Examples
/// For a peer with a local path
/// ```
/// # if cfg!(miri) { return } // No `socket` in miri.
/// # use std::error::Error;
/// # #[tokio::main]
/// # async fn main() -> Result<(), Box<dyn Error>> {
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
/// use tokio::net::UnixDatagram;
/// use tempfile::tempdir;
///
@@ -1510,10 +1510,10 @@ impl UnixDatagram {
///
/// For an unbound peer
/// ```
/// # if cfg!(miri) { return } // No SOCK_DGRAM for `socketpair` in miri.
/// # use std::error::Error;
/// # #[tokio::main]
/// # async fn main() -> Result<(), Box<dyn Error>> {
/// # if cfg!(miri) { return Ok(()); } // No SOCK_DGRAM for `socketpair` in miri.
/// use tokio::net::UnixDatagram;
///
/// // Create the pair of sockets
@@ -1532,10 +1532,10 @@ impl UnixDatagram {
///
/// # Examples
/// ```
/// # if cfg!(miri) { return } // No `socket` in miri.
/// # use std::error::Error;
/// # #[tokio::main]
/// # async fn main() -> Result<(), Box<dyn Error>> {
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
/// use tokio::net::UnixDatagram;
///
/// // Create an unbound socket
@@ -1560,10 +1560,10 @@ impl UnixDatagram {
///
/// # Examples
/// ```
/// # if cfg!(miri) { return } // No SOCK_DGRAM for `socketpair` in miri.
/// # use std::error::Error;
/// # #[tokio::main]
/// # async fn main() -> Result<(), Box<dyn Error>> {
/// # if cfg!(miri) { return Ok(()); } // No SOCK_DGRAM for `socketpair` in miri.
/// use tokio::net::UnixDatagram;
/// use std::net::Shutdown;
///
+1 -1
View File
@@ -840,7 +840,6 @@ impl UnixStream {
/// # Examples
///
/// ```
/// # if cfg!(miri) { return } // No `socket` in miri.
/// use std::error::Error;
/// use std::io::Read;
/// use tokio::net::UnixListener;
@@ -849,6 +848,7 @@ impl UnixStream {
///
/// #[tokio::main]
/// async fn main() -> Result<(), Box<dyn Error>> {
/// # if cfg!(miri) { return Ok(()); } // No `socket` in miri.
/// let dir = tempfile::tempdir().unwrap();
/// let bind_path = dir.path().join("bind_path");
///
+1 -2
View File
@@ -810,7 +810,6 @@ impl Command {
/// Basic usage:
///
/// ```no_run
/// # if cfg!(miri) { return } // No `pidfd_spawnp` in miri.
/// use tokio::process::Command;
///
/// async fn run_ls() -> std::process::ExitStatus {
@@ -1347,7 +1346,6 @@ impl Child {
/// This function is cancel safe.
///
/// ```
/// # if cfg!(miri) { return } // No `pidfd_spawnp` in miri.
/// # #[cfg(not(unix))]fn main(){}
/// # #[cfg(unix)]
/// use tokio::io::AsyncWriteExt;
@@ -1359,6 +1357,7 @@ impl Child {
/// # #[cfg(unix)]
/// #[tokio::main]
/// async fn main() {
/// # if cfg!(miri) { return; } // No `pidfd_spawnp` in miri.
/// let mut child = Command::new("cat")
/// .stdin(Stdio::piped())
/// .spawn()
+1 -1
View File
@@ -407,7 +407,6 @@ impl Runtime {
/// # Examples
///
/// ```
/// # if cfg!(miri) { return } // Miri reports error when main thread terminated without waiting all remaining threads.
/// use tokio::runtime::Runtime;
/// use tokio::task;
///
@@ -415,6 +414,7 @@ impl Runtime {
/// use std::time::Duration;
///
/// fn main() {
/// # if cfg!(miri) { return } // Miri reports error when main thread terminated without waiting all remaining threads.
/// let runtime = Runtime::new().unwrap();
///
/// runtime.block_on(async move {