Consider async blocks on lifetime errors #64382
Labels
A-async-await
Area: Async & Await
A-borrow-checker
Area: The borrow checker
A-diagnostics
Area: Messages for errors, warnings, and lints
AsyncAwait-Polish
Async-await issues that are part of the "polish" area
AsyncAwait-Triaged
Async-await issues that have been triaged during a working group meeting.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Uh oh!
There was an error while loading. Please reload this page.
The following incorrect code
emits the following error
The correct code needs the
buf
to be part of theasync
block because it is a stack allocation that needs to be in the generator:Ideally, the error message would mention
buf
:thanks to @bluejekyll for bringing this up!
CC @nikomatsakis
The text was updated successfully, but these errors were encountered: