-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Why implementation of iterator is not generic enough in async context? #71671
Copy link
Copy link
Open
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsAsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.Async-await issues that have been triaged during a working group meeting.C-bugCategory: This is a bug.Category: This is a bug.D-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.fixed-by-higher-ranked-assumptionsFixed by `-Zhigher-ranked-assumptions`Fixed by `-Zhigher-ranked-assumptions`
Metadata
Metadata
Assignees
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsAsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.Async-await issues that have been triaged during a working group meeting.C-bugCategory: This is a bug.Category: This is a bug.D-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.fixed-by-higher-ranked-assumptionsFixed by `-Zhigher-ranked-assumptions`Fixed by `-Zhigher-ranked-assumptions`
Type
Fields
Give feedbackNo fields configured for issues without a type.
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