-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 #60227
Conversation
r? @cramertj (rust_highfive has picked a reviewer for you, use r? to override) |
52173d5
to
4d33df4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good so far!
.upvar_list[&def_id] | ||
.iter() | ||
.zip(substs.upvar_tys(def_id, cx.tcx)) | ||
.enumerate() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks about right =)
let upvar_capture = cx.tables().upvar_capture(upvar_id); | ||
let temp_lifetime = cx.region_scope_tree.temporary_scope(closure_expr.hir_id.local_id); | ||
let var_ty = cx.tables().node_type(var_hir_id); | ||
let var_ty = cx.tables().node_type(upvar_id.var_path.hir_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it'd be better to pass the var_ty
in as a parameter -- but this seems ok too
☔ The latest upstream changes (presumably #60462) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (presumably #61276) made this pull request unmergeable. Please resolve the merge conflicts. |
I'm going to close this PR -- @csmoe let's discuss later restarting this effort :) |
@rustbot modify labels to -S-inactive +S-inactive-closed |
Address #60205