Upgrading tokio 0.3 to 1
Breaking0.3.7 → 1.54.1Breaking20Security7Platform7Deprecated2New301Changed190Fixed283Other284
SecurityRace condition in `tokio::time::Interval` on Tokio v1.54.0GHSA-5wjr-9356-4wc8 · CVE-2026-115567 ↗
BreakingUpgrade verdict
20 breaking changes and 7 platform requirement changes and 7 security fixes.
In plain terms
- runtime: removed borrow from LocalOptions parameter to runtime::Builder::build_local ().
- Removes the unused `stats` feature.
- Removes unused `tokio_*` cfgs.
- Removes the build script to speed up compilation.
Must act Top 5 of 36 that need code or config changes
Requires Rust 1.85 from 1.54.0 (none stated before).
What you must change
Breaking20
runtime: removed borrow from LocalOptions parameter to runtime::Builder::build_local ().
LocalOptionsruntime::Builder::build_localRemoves the unused
stats feature.statsRemoves unused
tokio_* cfgs.tokio_*Removes the build script to speed up compilation.
Removes the
Send implementation from runtime::EnterGuard, fixing a bug that should not impact most users.runtime::EnterGuardRenames unstable
join_one to join_next in joinset.join_onejoin_nextRemoves RwLockWriteGuard::map and RwLockWriteGuard::try_map to fix a soundness hole with RwLockWriteGuard::downgrade.
RwLockWriteGuard::mapRwLockWriteGuard::try_mapRwLockWriteGuard::downgradeRenames
AsyncFd::with_io() to try_io().AsyncFd::with_io()AsyncFd::try_io()Renames
runtime::Builder::max_threads() to max_blocking_threads().runtime::Builder::max_threads()runtime::Builder::max_blocking_threads()Removes
tokio::prelude.tokio::preludeRemoves
AsyncFd::with_poll().AsyncFd::with_poll()Removes
{Tcp,Unix}Stream::shutdown() in favor of AsyncWrite::shutdown().TcpStream::shutdown()UnixStream::shutdown()AsyncWrite::shutdown()Removes mpsc
try_recv() due to unexpected behavior.try_recv()Makes the unstable
task::Builder::spawn* methods fallible.task::Builder::spawn*Overhauls the runtime metrics API when building with --cfg tokio_unstable.
Makes
Sleep !Unpin.SleepPasses
SocketAddr by value.SocketAddrChanges
TcpStream::poll_peek to take ReadBuf.TcpStream::poll_peekReadBufRequires the
current_thread runtime when calling time::pause().time::pause()current_threadMoves all stream utilities to
tokio-stream until Stream is added to std.tokio-streamStreamSecurity7
Race condition in
tokio::time::Interval on Tokio v1.54.0AsyncFd::new and related constructors violate I/O safetyBroadcast channel calls clone in parallel, but does not require
Synctokio::io::ReadHalf<T>::unsplit is Unsoundreject_remote_clients Configuration corruption
Fixes a data race between oneshot::Sender::send and awaiting a oneshot::Receiver when the oneshot has been closed.
oneshot::Sender::sendoneshot::ReceiverTask dropped in wrong thread when aborting
LocalSet taskPlatform7
Increases the minimum supported Rust version (MSRV) to 1.85.
Bumps the minimum supported Rust version (MSRV) to 1.70.
Bumps the MSRV of Tokio to 1.63.
Bumps the MSRV of Tokio to 1.56.
Removes the dependency on the once_cell crate to restore the MSRV of the 1.18.x LTS release.
once_cellUpdates the minimum supported Rust version to 1.49.
Updates the minimum supported Rust version to 1.46.
Deprecations to plan for
Deprecated2
Deprecates AsyncFd::new, AsyncFd::with_interest, AsyncFd::try_new and AsyncFd::try_with_interest.
AsyncFd::newAsyncFd::with_interestAsyncFd::try_newAsyncFd::try_with_interestDeprecates the unused
mpsc::RecvError type.mpsc::RecvError