Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upDropped variables still included in generator type #57478
Comments
estebank
added
C-bug
A-generators
labels
Jan 9, 2019
This comment has been minimized.
This comment has been minimized.
|
I'd like to work on this. |
This comment has been minimized.
This comment has been minimized.
|
This is going to be tricky. The error is occurring due to the computed generator witness type including Making this work would require type resolution to depend on the results of NLL. Specifically, the computed generator witness type would have to depend on which locals are computed to be live during mir-borrowck. @Zoxc @nikomatsakis: Thoughts? |
This comment has been minimized.
This comment has been minimized.
|
My plan for this is just to generate MIR for just the generator during type checking and then do the analysis on MIR. Currently that isn't very feasible given the current compiler structure. |
Nemo157 commentedJan 9, 2019
(full playground) fails with
The guard should be dead and deallocated before the yield point so shouldn't appear in the generator type and affect the
Sendness. Wrapping the guard in a new scope before theyieldavoids this (included in the playground). First noticed in relation to async functions on u.rl.o.