Can't infer type after collecting an iterator of futures #61991
Labels
A-async-await
Area: Async & Await
A-diagnostics
Area: Messages for errors, warnings, and lints
A-inference
Area: Type inference
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
This code fails to compile:
Error message:
More details:
Annotating variable type fixes the error:
let futures_to_wait: Vec<_> = ...
@Nemo157 kindly created a playground example with similar error (though a bit different, mentioning generators instead of async objects:
type inside generator must be known in this context
)https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=deaf09047f91d098705bcf90f894fd72
The text was updated successfully, but these errors were encountered: