Skip to content

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.

  • 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.
Top 5 of 31 that need code or config changes

Requires Rust 1.71 from 0.3.32 (none stated before).

Breaking20
Remove dependency to pin-utils.
pin-utils
Remove dependency on num_cpus.
num_cpus
Removes the Unpin bound from TryStreamExt::into_async_read.
TryStreamExt::into_async_readUnpin
Removes the unstable read-initializer feature.
read-initializer
Removes the Send bound on the output of RemoteHandle.
RemoteHandleSend
Removes ThreadPool::run.
ThreadPool::run
Removes BufReader::poll_seek_relative.
BufReader::poll_seek_relative
Removes Stream impl for VecDeque.
StreamVecDeque
Renames Peekable::peek to poll_peek.
Peekable::peekPeekable::poll_peek
Renames oneshot::Sender::poll_cancel to poll_canceled.
oneshot::Sender::poll_canceloneshot::Sender::poll_canceled
Fix soundness bug in task::waker_ref This is a breaking change but allowed because it is soundness bug fix.
task::waker_ref
Fix 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::unfold
Fixes the signature of the LocalSpawn trait, a breaking change.
LocalSpawn
Changes Spawn trait and FuturesUnordered::push to take &self.
SpawnFuturesUnordered::push
Moves Spawn and FutureObj out of futures-core and into futures-task.
SpawnFutureObjfutures-corefutures-task
Changes case convention for feature names.
Moves copy_into and copy_buf_into.
copy_intocopy_buf_into
Changes SinkExt::send_all to accept a TryStream.
SinkExt::send_allTryStream
Changes skip to take a usize rather than a u64.
skip
Security4
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_string
MutexGuard::map can cause a data race in safe code
Medium · CVSS 4.7
Improper Sync implementation on FuturesUnordered in futures-utils can cause data corruption
Medium · CVSS 5.5
Platform4
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-hack
Supports targets that do not have atomic CAS on stable Rust.
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