Using the format!() macro with an async function makes the whole Future non-Send #101650
Labels
A-fmt
Area: `core::fmt`
C-bug
Category: This is a bug.
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
I tried this code: (minimal reproducible example; for the actual code see chatmail/core#3591)
Playground
Note that we are using,
in a context where the Future needs to be
Send
; only this line without thestring_builder
seems not to be able to reproduce the issue though.I expected to see this happen: That the code behaves the same as
Instead, this happened:
There are two error messages (about line 5 and line 7); this issue is about the first one:
The second error message didn't appear in the original issue in chatmail/core#3591, possibly because there the call to
Box::pin()
and theformat!()
call are in two different crates:Meta
rustc --version --verbose
Probably doesn't matter, anyway:
@rustbot label +A-fmt
The text was updated successfully, but these errors were encountered: