-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
refactor uses of freevars to use the upvar list #60205
Comments
Mentoring instructionsThe first use is in rust/src/librustc_mir/hair/cx/expr.rs Line 534 in 7b4f8f9
In this code, we zip two lists:
These lists are meant to contain the same number of items. I think we want to change this to iterate over the Next problem: the old code was giving us a vector of rust/src/librustc_mir/hair/cx/expr.rs Lines 1181 to 1185 in 7b4f8f9
which in turn uses the parameter rust/src/librustc_mir/hair/cx/expr.rs Lines 1186 to 1190 in 7b4f8f9
So, basically, we can now pass in the
A nicer refactoring, though, might be to extract out the handling of upvars from |
I'd like to work on this. |
Is this issue still available to be picked up? I would like to work on it. |
@hbina the instructions above is kind of out-date. rfc-2229 is paused now, you can subscribe to this workgroup in complier-team repo to get the latest update once it restarts. |
@csmoe oh, I didn't know thats a thing. Heading over there now! |
I think this issue is kind of outdated, closing |
As part of #53488, we need to refactor code that relies on the
freevars
helper to figure out what things a closure captures. The freevars function just lists the "base variables" that a closure uses. This used to be equivalent to the sets of captures but that is what we are trying to change.@blitzerr already introduced a new field to the
TypeckTables
, theupvar_list
. This maps from each closure to the list of upvars captured by it. These upvars are identified by aUpvarId
-- eventually, though, they will be expected to contain additional information, so that a closure like|| foo(&x.y.z)
might record that it capturesx.y.z
and not justx
.There is a list of freevars uses in this dropbox paper document. This issue should be extended with a list of the uses. I'll also add some mentoring instructions for specific cases to try and get things rolling.
There is a Zulip topic for discussion of this issue.
The text was updated successfully, but these errors were encountered: