Why implementation of iterator is not generic enough in async context? #71671
Labels
A-async-await
Area: Async & Await
A-diagnostics
Area: Messages for errors, warnings, and lints
AsyncAwait-Triaged
Async-await issues that have been triaged during a working group meeting.
C-bug
Category: This is a bug.
D-confusing
Confusing diagnostic error that should be reworked
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Cross posting stackoverflow because it's look like a compiler bug/limitation.
Given the following snippet:
I get the following errors:
I was expecting no error because the lifetimes seem to be correct to me. Note that removing
main()
or removing the code insidefrom_bar()
both eliminate the errors. Not only that, the error messages are also very strange. They may be related to a regression in the compiler, though more than that they seem to be in the wrong place (maybe related).Version
rustc 1.43.0 (4fb7144ed 2020-04-20)
:Maybe related #64650
The text was updated successfully, but these errors were encountered: