implementation of Debug is not general enough
when making async block into &dyn Future + Send
#87425
Labels
A-async-await
Area: Async & Await
A-lifetimes
Area: Lifetimes / regions
AsyncAwait-Triaged
Async-await issues that have been triaged during a working group meeting.
C-bug
Category: This is a bug.
fixed-by-next-solver
Fixed by the next-generation trait solver, `-Znext-solver`.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
WG-async
Working group: Async & await
I tried this code:
Link to playground
I expected to see this compile.
Instead, this happened:
I've hit the "implementation of
Debug
is not general enough" when trying to make the async block into a trait object withSend
bound.Compile error output
One interesting detail is that this works only with closure syntax, if you use vanilla
fn
, then there is no error, also removing+ Send
bound on the resulting trait object removes the error.Meta
rustc --version --verbose
:This is also reproducible in playground with
beta
andnightly
channels:1.54.0-beta.3 (2021-07-20 3a5d335d1192975c94fc)
1.55.0-nightly (2021-07-22 027187094ee05011d660)
Sorry, I couldn't come up with a more descriptive issue name, if anyone can improve it, I'd be grateful for your edits.
Potentially related issues:
The text was updated successfully, but these errors were encountered: