Make inline attributes apply to the generated poll in async fn#149245
Make inline attributes apply to the generated poll in async fn#149245xacrimon wants to merge 1 commit intorust-lang:mainfrom
poll in async fn#149245Conversation
|
rustbot has assigned @JonathanBrouwer. Use |
This comment has been minimized.
This comment has been minimized.
46d6c3e to
d89022a
Compare
This comment has been minimized.
This comment has been minimized.
9478bfd to
fa35f7b
Compare
This comment has been minimized.
This comment has been minimized.
|
@rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
|
☔ The latest upstream changes (presumably #149853) made this pull request unmergeable. Please resolve the merge conflicts. |
|
☔ The latest upstream changes made this pull request unmergeable. Please resolve the merge conflicts. |
|
Triage: Are you still working on this @xacrimon? |
… instead of the desugared creator function.
fa35f7b to
7054408
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This PR adds lowering code (similar to how track_caller forwarding works) to
async fnitems andasync ||closures such that any inline attributes put on them are inherited by the generated coroutine (corresponding to thepoll()implementation) and are not applied to the outer function. This behavior matches the accepted FCP in the first linked issue.Code like the following now correctly codegen 3 functions
async_fn_test::consumerasync_fn_test::hi::{closure#0}core::ptr::drop_in_place::<async_fn_test::hi::{closure#0}>Fixes #129347 and fixes #106765.