Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

manual_async_fn: take input lifetimes into account #5859

Merged
merged 1 commit into from
Aug 5, 2020

Conversation

ebroto
Copy link
Member

@ebroto ebroto commented Aug 2, 2020

The anonymous future returned from an async fn captures all input
lifetimes. This was not being taken into account.

See https://github.com/rust-lang/rfcs/blob/master/text/2394-async_await.md#lifetime-capture-in-the-anonymous-future

changelog: Take input lifetimes into account in [manual_async_fn].

Fixes #5765

The anonymous future returned from an `async fn` captures all input
lifetimes. This was not being taken into account.

See https://github.com/rust-lang/rfcs/blob/master/text/2394-async_await.md#lifetime-capture-in-the-anonymous-future
@rust-highfive
Copy link

r? @matthiaskrgr

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Aug 2, 2020
@ebroto
Copy link
Member Author

ebroto commented Aug 3, 2020

I just realized I'm missing a test in the issue mod to check that with the bounds added we don't trigger the compile error. I'll add it ASAP.

@ebroto
Copy link
Member Author

ebroto commented Aug 3, 2020

Nevermind, the case I was mentioning in my previous comment should trigger a compilation error, we just have to test that we avoid the false positive (to avoid the error), which is already done.

PR should be ready to be reviewed, sorry for the confusion.

@flip1995
Copy link
Member

flip1995 commented Aug 4, 2020

Hijacking this PR to reopen the queue

@bors treeclosed-

Copy link
Member

@matthiaskrgr matthiaskrgr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks ok to me, however async is a chapter I have not yet dipped my toes into

@matthiaskrgr
Copy link
Member

r? @yaahc

@rust-highfive rust-highfive assigned yaahc and unassigned matthiaskrgr Aug 5, 2020
@yaahc
Copy link
Member

yaahc commented Aug 5, 2020

@matthiaskrgr lgtm

@bors r+

@bors
Copy link
Contributor

bors commented Aug 5, 2020

📌 Commit e336fe8 has been approved by yaahc

@bors
Copy link
Contributor

bors commented Aug 5, 2020

⌛ Testing commit e336fe8 with merge 2eab060...

@bors
Copy link
Contributor

bors commented Aug 5, 2020

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: yaahc
Pushing 2eab060 to master...

@bors bors merged commit 2eab060 into rust-lang:master Aug 5, 2020
@ebroto ebroto deleted the 5765_manual_async_fn_fp branch August 6, 2020 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

manual_async_fn false positive
6 participants