[async block]: Future<Output = Ty>
obligations don't provide inference guidance
#106527
Labels
A-async-await
Area: Async & Await
A-inference
Area: Type inference
AsyncAwait-Triaged
Async-await issues that have been triaged during a working group meeting.
C-bug
Category: This is a bug.
T-types
Relevant to the types team, which will review and decide on the PR/issue.
I tried this code:
I expected to see the code compile successfully. Instead, it fails with:
... should this work? Similar code works for closures: playground
I've got an experimental branch with some changes underway that could make this work (they don't work currently, but for somewhat orthogonal reasons) -- but first, I'm curious whether @rust-lang/types thinks this should work. Not going to keep on wasting my time if not.
~~
Ironically, this function compiles:
... because we do use the expectation
impl Future<Output = Box<dyn Trait>>
in the desugared async function. This only happens for async functions though, and not for async blocks (or presumably async closures).The text was updated successfully, but these errors were encountered: