Skip to content

rust: Panic dropping a future outside of an async context #1456

Open

Description

@alexcrichton

Code such as this:

fn main() {
    let (tx, rx) = wit_future::new(|| Ok(None));
    drop(tx);
    drop(rx);
}

will currently fail with:

thread 'main' (1) panicked at /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wit-bindgen-0.48.1/src/rt/async_support/waitable.rs:193:13:
assertion failed: !task.is_null()
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

(more context/discussion are here)

I'm not sure how best to handle this myself. It's not clear how frequently this will come up and if this means we basically need more libc integration or what.

Activity

  1. added
    gen-rustRelated to bindings for Rust-compiled-to-WebAssembly
    on Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    gen-rustRelated to bindings for Rust-compiled-to-WebAssembly

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions