write_fmt fails inside spawned task
- Dominant language
- Rust
- Stars
- 4.1k
- Forks
- 339
- PR merge metrics
- No merged PRs in 30d
Description
It turns out that [`Arguments`](https://doc.rust-lang.org/std/fmt/struct.Arguments.html#impl-Send) is non-`Send`, which means passing it to a spawned Future may not work because the future itself is `Send`.
```rust
use async_std::task;
use async_std::prelude::*;
use async_std::io;
fn main() {
task::block_on(async {
task::spawn(async {
// This doesn't compile
io::stderr().write_fmt(format_args!("hello")).await?;
}).await
})
}
```

This is causing some bugs. Posting this for future reference.
Contributor guide
Assessment
This issue has not been assessed yet.