Skip to content

Commit 8ccf2fb

Browse files
authored
ci: unfreeze wasm tests from rustc 1.88.0 (#7537)
1 parent bce76c5 commit 8ccf2fb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+3519
-3203
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -988,10 +988,10 @@ jobs:
988988
features: "macros sync time rt"
989989
steps:
990990
- uses: actions/checkout@v5
991-
- name: Install Rust 1.88.0
991+
- name: Install Rust ${{ env.rust_stable }}
992992
uses: dtolnay/rust-toolchain@stable
993993
with:
994-
toolchain: 1.88.0
994+
toolchain: ${{ env.rust_stable }}
995995
- name: Install wasm-pack
996996
uses: taiki-e/install-action@wasm-pack
997997

@@ -1011,10 +1011,10 @@ jobs:
10111011
- wasm32-wasip1-threads
10121012
steps:
10131013
- uses: actions/checkout@v4
1014-
- name: Install Rust 1.88.0
1014+
- name: Install Rust ${{ env.rust_stable }}
10151015
uses: dtolnay/rust-toolchain@stable
10161016
with:
1017-
toolchain: 1.88.0
1017+
toolchain: ${{ env.rust_stable }}
10181018
targets: ${{ matrix.target }}
10191019

10201020
# Install dependencies
@@ -1025,11 +1025,14 @@ jobs:
10251025

10261026
- uses: Swatinem/rust-cache@v2
10271027
- name: WASI test tokio full
1028-
run: cargo test -p tokio --target ${{ matrix.target }} --features full
1028+
run: cargo test -p tokio --target ${{ matrix.target }} --features "sync,macros,io-util,rt,time"
10291029
env:
10301030
CARGO_TARGET_WASM32_WASIP1_RUNNER: "wasmtime run --"
10311031
CARGO_TARGET_WASM32_WASIP1_THREADS_RUNNER: "wasmtime run -W bulk-memory=y -W threads=y -S threads=y --"
10321032
RUSTFLAGS: --cfg tokio_unstable -Dwarnings -C target-feature=+atomics,+bulk-memory -C link-args=--max-memory=67108864
1033+
# in order to run doctests for unstable features, we must also pass
1034+
# the unstable cfg to RustDoc
1035+
RUSTDOCFLAGS: --cfg tokio_unstable
10331036

10341037
- name: WASI test tokio-util full
10351038
run: cargo test -p tokio-util --target ${{ matrix.target }} --features full

tokio-stream/src/empty.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ unsafe impl<T> Sync for Empty<T> {}
2626
/// ```
2727
/// use tokio_stream::{self as stream, StreamExt};
2828
///
29-
/// #[tokio::main]
30-
/// async fn main() {
31-
/// let mut none = stream::empty::<i32>();
29+
/// # #[tokio::main(flavor = "current_thread")]
30+
/// # async fn main() {
31+
/// let mut none = stream::empty::<i32>();
3232
///
33-
/// assert_eq!(None, none.next().await);
34-
/// }
33+
/// assert_eq!(None, none.next().await);
34+
/// # }
3535
/// ```
3636
pub const fn empty<T>() -> Empty<T> {
3737
Empty(PhantomData)

tokio-stream/src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@
3434
//! ```rust
3535
//! use tokio_stream::{self as stream, StreamExt};
3636
//!
37-
//! #[tokio::main]
38-
//! async fn main() {
39-
//! let mut stream = stream::iter(vec![0, 1, 2]);
37+
//! # #[tokio::main(flavor = "current_thread")]
38+
//! # async fn main() {
39+
//! let mut stream = stream::iter(vec![0, 1, 2]);
4040
//!
41-
//! while let Some(value) = stream.next().await {
42-
//! println!("Got {}", value);
43-
//! }
41+
//! while let Some(value) = stream.next().await {
42+
//! println!("Got {}", value);
4443
//! }
44+
//! # }
4545
//! ```
4646
//!
4747
//! # Returning a Stream from a function

tokio-stream/src/once.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ impl<I> Unpin for Once<I> {}
2222
/// ```
2323
/// use tokio_stream::{self as stream, StreamExt};
2424
///
25-
/// #[tokio::main]
26-
/// async fn main() {
27-
/// // one is the loneliest number
28-
/// let mut one = stream::once(1);
25+
/// # #[tokio::main(flavor = "current_thread")]
26+
/// # async fn main() {
27+
/// // one is the loneliest number
28+
/// let mut one = stream::once(1);
2929
///
30-
/// assert_eq!(Some(1), one.next().await);
30+
/// assert_eq!(Some(1), one.next().await);
3131
///
32-
/// // just one, that's all we get
33-
/// assert_eq!(None, one.next().await);
34-
/// }
32+
/// // just one, that's all we get
33+
/// assert_eq!(None, one.next().await);
34+
/// # }
3535
/// ```
3636
pub fn once<T>(value: T) -> Once<T> {
3737
Once {

tokio-stream/src/stream_close.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@ pin_project! {
1717
/// ```
1818
/// use tokio_stream::{StreamExt, StreamMap, StreamNotifyClose};
1919
///
20-
/// #[tokio::main]
21-
/// async fn main() {
22-
/// let mut map = StreamMap::new();
23-
/// let stream = StreamNotifyClose::new(tokio_stream::iter(vec![0, 1]));
24-
/// let stream2 = StreamNotifyClose::new(tokio_stream::iter(vec![0, 1]));
25-
/// map.insert(0, stream);
26-
/// map.insert(1, stream2);
27-
/// while let Some((key, val)) = map.next().await {
28-
/// match val {
29-
/// Some(val) => println!("got {val:?} from stream {key:?}"),
30-
/// None => println!("stream {key:?} closed"),
31-
/// }
20+
/// # #[tokio::main(flavor = "current_thread")]
21+
/// # async fn main() {
22+
/// let mut map = StreamMap::new();
23+
/// let stream = StreamNotifyClose::new(tokio_stream::iter(vec![0, 1]));
24+
/// let stream2 = StreamNotifyClose::new(tokio_stream::iter(vec![0, 1]));
25+
/// map.insert(0, stream);
26+
/// map.insert(1, stream2);
27+
/// while let Some((key, val)) = map.next().await {
28+
/// match val {
29+
/// Some(val) => println!("got {val:?} from stream {key:?}"),
30+
/// None => println!("stream {key:?} closed"),
3231
/// }
3332
/// }
33+
/// # }
3434
/// ```
3535
#[must_use = "streams do nothing unless polled"]
3636
pub struct StreamNotifyClose<S> {

0 commit comments

Comments
 (0)