2

Fix `ByMove` coroutine-closure shim (for 2021 precise closure capturing behavior...

 3 weeks ago
source link: https://github.com/rust-lang/rust/pull/123518
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Conversation

This PR reworks the way that we perform the ByMove coroutine-closure shim to account for the fact that the upvars of the outer coroutine-closure and the inner coroutine might not line up due to edition-2021 closure capture rules changes.

Specifically, the number of upvars may differ and/or the inner coroutine may have additional projections applied to an upvar. This PR reworks the information we pass into the ByMoveBody MIR visitor to account for both of these facts.

I tried to leave comments explaining exactly what everything is doing, but let me know if you have questions.

r? oli-obk


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK