Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ jobs:
run: rustup target add wasm32-unknown-unknown
- name: Install wasm32-wasip1 target
run: rustup target add wasm32-wasip1
- name: Install wasm32v1-none target
run: rustup target add wasm32v1-none

# Verify the output of the `./ci/rebuild-libwit-bindgen-cabi.sh` script is
# up-to-date.
Expand Down Expand Up @@ -227,6 +229,10 @@ jobs:
- run: cargo build --target wasm32-wasip1 -p wit-bindgen --no-default-features --features inter-task-wakeup
- run: cargo build --target wasm32-wasip1 -p wit-bindgen --no-default-features --features futures-stream

# wasm32v1-none has no std, so a stray std::* usage fails to link here.
- run: cargo build --target wasm32v1-none -p wit-bindgen --no-default-features --features async
- run: cargo build --target wasm32v1-none -p wit-bindgen --no-default-features --features async-spawn

# Verity that documentation can be generated for the rust bindings crate.
- run: rustup update nightly --no-self-update
- run: cargo +nightly doc -p wit-bindgen --no-deps
Expand Down
4 changes: 2 additions & 2 deletions crates/guest-rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ all-features = true
[dependencies]
wit-bindgen-rust-macro = { path = "./macro", optional = true, default-features = false, version = "0.57.1" }
bitflags = { workspace = true, optional = true }
futures = { version = "0.3.30", optional = true }
futures = { version = "0.3.30", optional = true, default-features = false, features = ["alloc"] }

# When built as part of libstd
core = { version = "1.0", optional = true, package = "rustc-std-workspace-core" }
Expand All @@ -40,7 +40,7 @@ realloc = []
std = []
async = []
bitflags = ["dep:bitflags"]
async-spawn = ['async', 'dep:futures', 'std']
async-spawn = ['async', 'dep:futures']
futures-stream = ['async', 'dep:futures']
macro-string = ["wit-bindgen-rust-macro?/macro-string"]

Expand Down
8 changes: 4 additions & 4 deletions crates/guest-rust/src/rt/async_support/spawn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
#![allow(static_mut_refs)]

use crate::rt::async_support::BoxFuture;
use alloc::boxed::Box;
use alloc::vec::Vec;
use core::future::Future;
use core::task::{Context, Poll};
use futures::stream::{FuturesUnordered, StreamExt};
use std::boxed::Box;
use std::future::Future;
use std::task::{Context, Poll};
use std::vec::Vec;

/// Any newly-deferred work queued by calls to the `spawn` function while
/// polling the current task.
Expand Down
Loading