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

refactor uses of freevars to use the upvar list #60227

Draft
wants to merge 1 commit into
base: master
from

Conversation

@csmoe
Copy link
Member

commented Apr 24, 2019

Address #60205

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented Apr 24, 2019

r? @cramertj

(rust_highfive has picked a reviewer for you, use r? to override)

@csmoe csmoe force-pushed the csmoe:upvar branch 3 times, most recently from 52173d5 to 4d33df4 Apr 24, 2019

@cramertj

This comment has been minimized.

Copy link
Member

commented Apr 24, 2019

@nikomatsakis
Copy link
Contributor

left a comment

looks good so far!

.upvar_list[&def_id]
.iter()
.zip(substs.upvar_tys(def_id, cx.tcx))
.enumerate()

This comment has been minimized.

Copy link
@nikomatsakis

nikomatsakis Apr 30, 2019

Contributor

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);

This comment has been minimized.

Copy link
@nikomatsakis

nikomatsakis Apr 30, 2019

Contributor

I wonder if it'd be better to pass the var_ty in as a parameter -- but this seems ok too

@bors

This comment has been minimized.

Copy link
Contributor

commented May 4, 2019

☔️ The latest upstream changes (presumably #60462) made this pull request unmergeable. Please resolve the merge conflicts.

@csmoe csmoe force-pushed the csmoe:upvar branch from 4d33df4 to 53b2ce9 May 9, 2019

@csmoe csmoe force-pushed the csmoe:upvar branch from 53b2ce9 to 609dd07 May 22, 2019

@csmoe csmoe force-pushed the csmoe:upvar branch from 609dd07 to 1691f35 May 31, 2019

@bors

This comment has been minimized.

Copy link
Contributor

commented Jun 2, 2019

☔️ The latest upstream changes (presumably #61276) made this pull request unmergeable. Please resolve the merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.