tokio-1.52.0

tokio-rs/tokiotokio-1.52.0Apr 14, 2026by hawkw

AI Summary

This release adds I/O safety support, introduces a `try_io` function for pipe types, and includes an unstable setting to enable eager driver handoff. It also features performance improvements to the `spawn_blocking` scalability and worker queue management.

Key Highlights

  • Added `AioSource::register_borrowed` for I/O safety support
  • Added `try_io` function to `unix::pipe` sender and receiver types
  • Unstable: `enable_eager_driver_handoff` for runtime optimization
  • Improved `spawn_blocking` scalability with sharded queue

New Features

  • I/O safety support via `register_borrowed`
  • New `try_io` function for pipe operations
  • Unstable eager driver handoff setting
  • Unstable `trace_with` for customized task dumps
  • Unstable `io_uring` support for `AsyncRead` on File

Full Release Notes

# 1.52.0 (April 14th, 2026)

## Added

- io: `AioSource::register_borrowed` for I/O safety support ([#7992])
- net: add `try_io` function to `unix::pipe` sender and receiver types ([#8030])

## Added (unstable)

- runtime: `Builder::enable_eager_driver_handoff` setting enable eager hand off of the I/O and time drivers before polling tasks ([#8010])
- taskdump: add `trace_with()` for customized task dumps ([#8025])
- taskdump: allow `impl FnMut()` in `trace_with` instead of just `fn()` ([#8040])
- fs: support `io_uring` in `AsyncRead` for `File` ([#7907])

## Changed

- runtime: improve `spawn_blocking` scalability with sharded queue ([#7757])
- runtime: use `compare_exchange_weak()` in worker queue ([#8028])

## Fixed

- runtime: overflow second half of tasks when local queue is filled instead of first half ([#8029])

## Documented

- docs: fix typo in `oneshot::Sender::send` docs ([#8026])
- docs: hide #[tokio::main] attribute in the docs of `sync::watch` ([#8035])
- net: add docs on `ConnectionRefused` errors with UDP sockets ([#7870])

[#7757]: https://github.com/tokio-rs/tokio/pull/7757
[#7870]: https://github.com/tokio-rs/tokio/pull/7870
[#7907]: https://github.com/tokio-rs/tokio/pull/7907
[#7992]: https://github.com/tokio-rs/tokio/pull/7992
[#8010]: https://github.com/tokio-rs/tokio/pull/8010
[#8025]: https://github.com/tokio-rs/tokio/pull/8025
[#8026]: https://github.com/tokio-rs/tokio/pull/8026
[#8028]: https://github.com/tokio-rs/tokio/pull/8028
[#8029]: https://github.com/tokio-rs/tokio/pull/8029
[#8030]: https://github.com/tokio-rs/tokio/pull/8030
[#8035]: https://github.com/tokio-rs/tokio/pull/8035
[#8040]: https://github.com/tokio-rs/tokio/pull/8040