Upgrading futures-util 0.2 to 0.3
Breaking0.2.1 → 0.3.34Breaking20Security4Platform4Deprecated3New95Changed24Fixed40Other14
BreakingUpgrade verdict
20 breaking changes and 4 platform requirement changes and 4 security fixes.
In plain terms
- Remove dependency to pin-utils.
- Remove dependency on num_cpus.
- Lets more stream types be converted into async readers, since they no longer need to be safe to move in memory.
- An experimental feature for reading data before it is fully initialized is no longer available.
Must act Top 5 of 31 that need code or config changes
Requires Rust 1.71 from 0.3.32 (none stated before).
What you must change
Breaking20
Remove dependency to pin-utils.
pin-utilsRemove dependency on num_cpus.
num_cpusRemoves the
Unpin bound from TryStreamExt::into_async_read.TryStreamExt::into_async_readUnpinRemoves the unstable
read-initializer feature.read-initializerRemoves the Send bound on the output of RemoteHandle.
RemoteHandleSendRemoves
ThreadPool::run.ThreadPool::runRemoves
BufReader::poll_seek_relative.BufReader::poll_seek_relativeRemoves
Stream impl for VecDeque.StreamVecDequeRenames
Peekable::peek to poll_peek.Peekable::peekPeekable::poll_peekRenames
oneshot::Sender::poll_cancel to poll_canceled.oneshot::Sender::poll_canceloneshot::Sender::poll_canceledFix soundness bug in task::waker_ref This is a breaking change but allowed because it is soundness bug fix.
task::waker_refFix parsing issue in select!/select_biased!
select!select_biased!Fixes type inference in sink::unfold by specifying more of its types, which is a breaking change.
sink::unfoldFixes the signature of the
LocalSpawn trait, a breaking change.LocalSpawnChanges
Spawn trait and FuturesUnordered::push to take &self.SpawnFuturesUnordered::pushMoves
Spawn and FutureObj out of futures-core and into futures-task.SpawnFutureObjfutures-corefutures-taskChanges case convention for feature names.
Moves
copy_into and copy_buf_into.copy_intocopy_buf_intoChanges
SinkExt::send_all to accept a TryStream.SinkExt::send_allTryStreamChanges
skip to take a usize rather than a u64.skipSecurity4
Fixes a soundness issue in the
join! and try_join! macros (#2649).join!try_join!Fixes a heap buffer overflow in AsyncReadExt::read_to_end and AsyncReadExt::read_to_string.
AsyncReadExt::read_to_endAsyncReadExt::read_to_stringMutexGuard::map can cause a data race in safe code
Medium · CVSS 4.7Improper
Medium · CVSS 5.5Sync implementation on FuturesUnordered in futures-utils can cause data corruptionPlatform4
Bump MSRV of utility crates to 1.71.
Updates to syn 2, raising the MSRV of utility crates to 1.56.
Removes the
proc-macro-hack dependency, raising the MSRV of utility crates to 1.45.proc-macro-hackSupports targets that do not have atomic CAS on stable Rust.
Deprecations to plan for
Deprecated3
Soft-deprecate ready! macro in favor of std::task::ready! added in Rust 1.64.
ready!std::task::ready!Soft-deprecate pin_mut! macro in favor of std::pin::pin! added in Rust 1.68.
pin_mut!std::pin::pin!Deprecates
FuturesOrdered::push in favor of FuturesOrdered::push_back.FuturesOrdered::pushFuturesOrdered::push_back