Skip to content

Commit

Permalink
Merge branch 'master' into noah/localruntime
Browse files Browse the repository at this point in the history
  • Loading branch information
Noah-Kennedy authored Sep 10, 2024
2 parents a57f0ed + 9116999 commit 4af3b72
Show file tree
Hide file tree
Showing 138 changed files with 453 additions and 424 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Make sure you activated the full features of the tokio crate on Cargo.toml:

```toml
[dependencies]
tokio = { version = "1.39.3", features = ["full"] }
tokio = { version = "1.40.0", features = ["full"] }
```
Then, on your main.rs:

Expand Down
3 changes: 2 additions & 1 deletion spellcheck.dic
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
285
286
&
+
<
Expand Down Expand Up @@ -99,6 +99,7 @@ errored
EWMA
expirations
fcntl
fd
fd's
FIFOs
filename
Expand Down
2 changes: 1 addition & 1 deletion tests-integration/src/bin/test-mem.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use futures::future::poll_fn;
use std::future::poll_fn;

fn main() {
let rt = tokio::runtime::Builder::new_multi_thread()
Expand Down
5 changes: 3 additions & 2 deletions tests-integration/tests/process_stdio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use futures::future::{self, FutureExt};
use std::env;
use std::io;
use std::process::{ExitStatus, Stdio};
use std::task::ready;

fn cat() -> Command {
let mut cmd = Command::new(env!("CARGO_BIN_EXE_test-cat"));
Expand Down Expand Up @@ -205,13 +206,13 @@ async fn vectored_writes() {
let mut input = Bytes::from_static(b"hello\n").chain(Bytes::from_static(b"world!\n"));
let mut writes_completed = 0;

futures::future::poll_fn(|cx| loop {
std::future::poll_fn(|cx| loop {
let mut slices = [IoSlice::new(&[]); 2];
let vectored = input.chunks_vectored(&mut slices);
if vectored == 0 {
return std::task::Poll::Ready(std::io::Result::Ok(()));
}
let n = futures::ready!(Pin::new(&mut stdin).poll_write_vectored(cx, &slices))?;
let n = ready!(Pin::new(&mut stdin).poll_write_vectored(cx, &slices))?;
writes_completed += 1;
input.advance(n);
})
Expand Down
12 changes: 12 additions & 0 deletions tokio-stream/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# 0.1.16 (September 5th, 2024)

This release bumps the MSRV of tokio-stream to 1.70.

- stream: add `next_many` and `poll_next_many` to `StreamMap` ([#6409])
- stream: make stream adapters public ([#6658])
- readme: add readme for tokio-stream ([#6456])

[#6409]: https://github.com/tokio-rs/tokio/pull/6409
[#6658]: https://github.com/tokio-rs/tokio/pull/6658
[#6456]: https://github.com/tokio-rs/tokio/pull/6456

# 0.1.15 (March 14th, 2024)

This release bumps the MSRV of tokio-stream to 1.63.
Expand Down
2 changes: 1 addition & 1 deletion tokio-stream/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name = "tokio-stream"
# - Remove path dependencies
# - Update CHANGELOG.md.
# - Create "tokio-stream-0.1.x" git tag.
version = "0.1.15"
version = "0.1.16"
edition = "2021"
rust-version = "1.70"
authors = ["Tokio Contributors <[email protected]>"]
Expand Down
3 changes: 0 additions & 3 deletions tokio-stream/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@
#[macro_use]
mod macros;

mod poll_fn;
pub(crate) use poll_fn::poll_fn;

pub mod wrappers;

mod stream_ext;
Expand Down
9 changes: 0 additions & 9 deletions tokio-stream/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,3 @@ macro_rules! cfg_signal {
)*
}
}

macro_rules! ready {
($e:expr $(,)?) => {
match $e {
std::task::Poll::Ready(t) => t,
std::task::Poll::Pending => return std::task::Poll::Pending,
}
};
}
35 changes: 0 additions & 35 deletions tokio-stream/src/poll_fn.rs

This file was deleted.

4 changes: 2 additions & 2 deletions tokio-stream/src/stream_ext/all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::Stream;
use core::future::Future;
use core::marker::PhantomPinned;
use core::pin::Pin;
use core::task::{Context, Poll};
use core::task::{ready, Context, Poll};
use pin_project_lite::pin_project;

pin_project! {
Expand Down Expand Up @@ -42,7 +42,7 @@ where

// Take a maximum of 32 items from the stream before yielding.
for _ in 0..32 {
match futures_core::ready!(stream.as_mut().poll_next(cx)) {
match ready!(stream.as_mut().poll_next(cx)) {
Some(v) => {
if !(me.f)(v) {
return Poll::Ready(false);
Expand Down
4 changes: 2 additions & 2 deletions tokio-stream/src/stream_ext/any.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::Stream;
use core::future::Future;
use core::marker::PhantomPinned;
use core::pin::Pin;
use core::task::{Context, Poll};
use core::task::{ready, Context, Poll};
use pin_project_lite::pin_project;

pin_project! {
Expand Down Expand Up @@ -42,7 +42,7 @@ where

// Take a maximum of 32 items from the stream before yielding.
for _ in 0..32 {
match futures_core::ready!(stream.as_mut().poll_next(cx)) {
match ready!(stream.as_mut().poll_next(cx)) {
Some(v) => {
if (me.f)(v) {
return Poll::Ready(true);
Expand Down
2 changes: 1 addition & 1 deletion tokio-stream/src/stream_ext/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::stream_ext::Fuse;
use crate::Stream;

use core::pin::Pin;
use core::task::{Context, Poll};
use core::task::{ready, Context, Poll};
use pin_project_lite::pin_project;

pin_project! {
Expand Down
2 changes: 1 addition & 1 deletion tokio-stream/src/stream_ext/chunks_timeout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use tokio::time::{sleep, Sleep};

use core::future::Future;
use core::pin::Pin;
use core::task::{Context, Poll};
use core::task::{ready, Context, Poll};
use pin_project_lite::pin_project;
use std::time::Duration;

Expand Down
2 changes: 1 addition & 1 deletion tokio-stream/src/stream_ext/collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use core::future::Future;
use core::marker::PhantomPinned;
use core::mem;
use core::pin::Pin;
use core::task::{Context, Poll};
use core::task::{ready, Context, Poll};
use pin_project_lite::pin_project;

// Do not export this struct until `FromStream` can be unsealed.
Expand Down
2 changes: 1 addition & 1 deletion tokio-stream/src/stream_ext/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::Stream;

use core::fmt;
use core::pin::Pin;
use core::task::{Context, Poll};
use core::task::{ready, Context, Poll};
use pin_project_lite::pin_project;

pin_project! {
Expand Down
2 changes: 1 addition & 1 deletion tokio-stream/src/stream_ext/filter_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::Stream;

use core::fmt;
use core::pin::Pin;
use core::task::{Context, Poll};
use core::task::{ready, Context, Poll};
use pin_project_lite::pin_project;

pin_project! {
Expand Down
2 changes: 1 addition & 1 deletion tokio-stream/src/stream_ext/fold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::Stream;
use core::future::Future;
use core::marker::PhantomPinned;
use core::pin::Pin;
use core::task::{Context, Poll};
use core::task::{ready, Context, Poll};
use pin_project_lite::pin_project;

pin_project! {
Expand Down
2 changes: 1 addition & 1 deletion tokio-stream/src/stream_ext/fuse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::Stream;

use pin_project_lite::pin_project;
use std::pin::Pin;
use std::task::{Context, Poll};
use std::task::{ready, Context, Poll};

pin_project! {
/// Stream returned by [`fuse()`][super::StreamExt::fuse].
Expand Down
2 changes: 1 addition & 1 deletion tokio-stream/src/stream_ext/skip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::Stream;

use core::fmt;
use core::pin::Pin;
use core::task::{Context, Poll};
use core::task::{ready, Context, Poll};
use pin_project_lite::pin_project;

pin_project! {
Expand Down
2 changes: 1 addition & 1 deletion tokio-stream/src/stream_ext/skip_while.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::Stream;

use core::fmt;
use core::pin::Pin;
use core::task::{Context, Poll};
use core::task::{ready, Context, Poll};
use pin_project_lite::pin_project;

pin_project! {
Expand Down
2 changes: 1 addition & 1 deletion tokio-stream/src/stream_ext/throttle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use tokio::time::{Duration, Instant, Sleep};

use std::future::Future;
use std::pin::Pin;
use std::task::{self, Poll};
use std::task::{self, ready, Poll};

use pin_project_lite::pin_project;

Expand Down
2 changes: 1 addition & 1 deletion tokio-stream/src/stream_ext/timeout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use tokio::time::{Instant, Sleep};

use core::future::Future;
use core::pin::Pin;
use core::task::{Context, Poll};
use core::task::{ready, Context, Poll};
use pin_project_lite::pin_project;
use std::fmt;
use std::time::Duration;
Expand Down
2 changes: 1 addition & 1 deletion tokio-stream/src/stream_ext/timeout_repeating.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::{Elapsed, Stream};
use tokio::time::Interval;

use core::pin::Pin;
use core::task::{Context, Poll};
use core::task::{ready, Context, Poll};
use pin_project_lite::pin_project;

pin_project! {
Expand Down
5 changes: 3 additions & 2 deletions tokio-stream/src/stream_map.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use crate::{poll_fn, Stream};
use crate::Stream;

use std::borrow::Borrow;
use std::future::poll_fn;
use std::hash::Hash;
use std::pin::Pin;
use std::task::{Context, Poll};
use std::task::{ready, Context, Poll};

/// Combine many streams into one, indexing each source stream with a unique
/// key.
Expand Down
2 changes: 1 addition & 1 deletion tokio-stream/src/wrappers/broadcast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use futures_core::Stream;
use tokio_util::sync::ReusableBoxFuture;

use std::fmt;
use std::task::{Context, Poll};
use std::task::{ready, Context, Poll};

/// A wrapper around [`tokio::sync::broadcast::Receiver`] that implements [`Stream`].
///
Expand Down
2 changes: 1 addition & 1 deletion tokio-stream/src/wrappers/watch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use futures_core::Stream;
use tokio_util::sync::ReusableBoxFuture;

use std::fmt;
use std::task::{Context, Poll};
use std::task::{ready, Context, Poll};
use tokio::sync::watch::error::RecvError;

/// A wrapper around [`tokio::sync::watch::Receiver`] that implements [`Stream`].
Expand Down
4 changes: 2 additions & 2 deletions tokio-test/src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ use tokio::sync::mpsc;
use tokio::time::{self, Duration, Instant, Sleep};
use tokio_stream::wrappers::UnboundedReceiverStream;

use futures_core::{ready, Stream};
use futures_core::Stream;
use std::collections::VecDeque;
use std::fmt;
use std::future::Future;
use std::pin::Pin;
use std::sync::Arc;
use std::task::{self, Poll, Waker};
use std::task::{self, ready, Poll, Waker};
use std::{cmp, io};

/// An I/O object that follows a predefined script.
Expand Down
4 changes: 2 additions & 2 deletions tokio-test/src/stream_mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@

use std::collections::VecDeque;
use std::pin::Pin;
use std::task::Poll;
use std::task::{ready, Poll};
use std::time::Duration;

use futures_core::{ready, Stream};
use futures_core::Stream;
use std::future::Future;
use tokio::time::{sleep_until, Instant, Sleep};

Expand Down
24 changes: 24 additions & 0 deletions tokio-util/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
# 0.7.12 (September 5th, 2024)

This release bumps the MSRV to 1.70. ([#6645])

### Added
- sync: Add `run_until_cancelled` to `tokio_util::sync::CancellationToken` ([#6618])
- task: add `AbortOnDropHandle` type ([#6786])

### Changed
- deps: no default features for hashbrown ([#6541])
- time: wake `DelayQueue` when removing last item ([#6752])
- deps: enable the full feature when compiled for the playground ([#6818])

### Documented
- task: fix typo in `TaskTracker` docs ([#6792])

[#6645]: https://github.com/tokio-rs/tokio/pull/6645
[#6541]: https://github.com/tokio-rs/tokio/pull/6541
[#6618]: https://github.com/tokio-rs/tokio/pull/6618
[#6752]: https://github.com/tokio-rs/tokio/pull/6752
[#6786]: https://github.com/tokio-rs/tokio/pull/6786
[#6792]: https://github.com/tokio-rs/tokio/pull/6792
[#6818]: https://github.com/tokio-rs/tokio/pull/6818

# 0.7.11 (May 4th, 2024)

This release updates the MSRV to 1.63. ([#6126])
Expand Down
5 changes: 4 additions & 1 deletion tokio-util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name = "tokio-util"
# - Remove path dependencies
# - Update CHANGELOG.md.
# - Create "tokio-util-0.7.x" git tag.
version = "0.7.11"
version = "0.7.12"
edition = "2021"
rust-version = "1.70"
authors = ["Tokio Contributors <[email protected]>"]
Expand Down Expand Up @@ -65,3 +65,6 @@ rustdoc-args = ["--cfg", "docsrs", "--cfg", "tokio_unstable"]
# it's necessary to _also_ pass `--cfg tokio_unstable` to rustc, or else
# dependencies will not be enabled, and the docs build will fail.
rustc-args = ["--cfg", "docsrs", "--cfg", "tokio_unstable"]

[package.metadata.playground]
features = ["full"]
3 changes: 1 addition & 2 deletions tokio-util/src/codec/framed_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ use futures_core::Stream;
use tokio::io::{AsyncRead, AsyncWrite};

use bytes::BytesMut;
use futures_core::ready;
use futures_sink::Sink;
use pin_project_lite::pin_project;
use std::borrow::{Borrow, BorrowMut};
use std::io;
use std::pin::Pin;
use std::task::{Context, Poll};
use std::task::{ready, Context, Poll};

pin_project! {
#[derive(Debug)]
Expand Down
Loading

0 comments on commit 4af3b72

Please sign in to comment.