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

Tracking issue for more precise generator captures #69663

Open
2 of 6 tasks
tmandry opened this issue Mar 3, 2020 · 4 comments
Open
2 of 6 tasks

Tracking issue for more precise generator captures #69663

tmandry opened this issue Mar 3, 2020 · 4 comments
Assignees
Labels
A-async-await A-generators A-typesystem AsyncAwait-Triaged C-enhancement E-hard T-compiler

Comments

@tmandry
Copy link
Contributor

@tmandry tmandry commented Mar 3, 2020

Today, valid programs using generators (and async/await) are rejected by the compiler because it thinks certain values may be held across yields when they are not.

Examples / to do: (please add more as they come up)

Unresolved Questions

How should we implement this?

Are there any programs which could be accepted, but shouldn't be because they would depend too heavily on implementation details of the compiler?

Implementation notes

There's some discussion here: #57017 (comment)

This issue has been assigned to @eholk via this comment.

@tmandry tmandry added the C-tracking-issue label Mar 3, 2020
@tmandry
Copy link
Contributor Author

@tmandry tmandry commented Mar 3, 2020

cc @nikomatsakis @Aaron1011

I've created a "meta-issue" to track these improvements.

@tmandry tmandry added C-enhancement A-async-await A-generators E-hard T-compiler and removed C-tracking-issue labels Mar 3, 2020
@tmandry tmandry added the AsyncAwait-Triaged label Mar 3, 2020
@jonas-schievink jonas-schievink added the A-typesystem label Mar 7, 2020
@jonas-schievink
Copy link
Member

@jonas-schievink jonas-schievink commented Mar 8, 2020

I've removed #69672 and moved it over to #69826

@tmandry
Copy link
Contributor Author

@tmandry tmandry commented Jul 16, 2021

@rustbot assign @eholk

@rustbot rustbot self-assigned this Jul 16, 2021
@tmandry tmandry added this to On deck in wg-async work via automation Jul 16, 2021
@tmandry tmandry moved this from On deck to Claimed in wg-async work Jul 16, 2021
jakubdabek added a commit to jakubdabek/Rocket that referenced this issue Aug 21, 2021
This commit implements a workaround for an [issue within rustc].
The problem showed itself when using e.g. a `Vec<&str>` argument
in an async route handler (but not `&str`), which resulted in a
"implementation of `FromForm` is not general enough" error.
The workaround itself works by gathering all invocations of
`FromForm`'s methods inside a block without any `.await` points [ref].

[issue within rustc]: rust-lang/rust#69663
[ref]: rust-lang/rust#57478 (comment)
jakubdabek added a commit to jakubdabek/Rocket that referenced this issue Aug 21, 2021
This commit implements a workaround for an [issue within rustc].
The problem showed itself when using e.g. a `Vec<&str>` argument
in an async route handler (but not `&str`), which resulted in a
"implementation of `FromForm` is not general enough" error.
The workaround itself works by gathering all invocations of
`FromForm`'s methods inside a block without any `.await` points [ref].

[issue within rustc]: rust-lang/rust#69663
[ref]: rust-lang/rust#57478 (comment)
SergioBenitez pushed a commit to SergioBenitez/Rocket that referenced this issue Aug 25, 2021
This commit implements a workaround for an [issue within rustc]. The
problem showed itself when using e.g. a `Vec<&str>` argument in an async
route handler (but not `&str`), which resulted in a "implementation of
`FromForm` is not general enough" error. The workaround itself works by
gathering all invocations of `FromForm`'s methods inside a block without
any `.await` points [ref].

[issue within rustc]: rust-lang/rust#69663
[ref]: rust-lang/rust#57478 (comment)
@eholk
Copy link
Contributor

@eholk eholk commented Feb 16, 2022

I think #94067 counts as another instance of this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-async-await A-generators A-typesystem AsyncAwait-Triaged C-enhancement E-hard T-compiler
Projects
Development

No branches or pull requests

4 participants