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

Closure region hierarchy #23109

Merged
merged 4 commits into from
Apr 1, 2015
Merged

Conversation

nikomatsakis
Copy link
Contributor

Adjust internal treatment of the region hierarchy around closures. Work towards #3696.

r? @pnkfelix

2. Parameters must outlive the region of any fn that they are passed to.

Therefore, we can -- sort of -- assume that when we are asked to
compare a region `'a` from a closure with a region `'b` from the fn
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so, I know what this comment is saying because we've talked about it, but this sentence as written is too difficult to parse. (In particular, I worry about someone misparsing it as "... to compare (a region 'a from (a closure with a region 'b)) from (the fn that encloses it) ..."

I know that grammatically, that alternative parsing does not make sense. But I still think a rephrasing is in order; this stuff is hard enough to follow as it is.

Maybe even just putting in a few more names:

Let C be some closure and let F be the fn that encloses it. When we are asked to compare a region 'a from C with a region 'b from F, we can in fact assume 'b is the larger region. (Sort of.)

@pnkfelix
Copy link
Member

@nikomatsakis feel free to r=me after addressing the comment-nits I noted above.

its own disjoint region tree, and the new table encodes the lexical
relationships between those trees.
hierarchies are judged based on the lexical relationship of their
respective fn bodies.
case where `None` was returned should never happen in practice; it
amounts to comparing regions from two unrelated hierarchies. (I was also
not able to make it happen.)
@nikomatsakis nikomatsakis force-pushed the closure-region-hierarchy branch from 1411d06 to f15813d Compare April 1, 2015 12:41
@nikomatsakis
Copy link
Contributor Author

@bors r=pnkfelix f15813d

bors added a commit that referenced this pull request Apr 1, 2015
Adjust internal treatment of the region hierarchy around closures. Work towards #3696.

r? @pnkfelix
@bors
Copy link
Contributor

bors commented Apr 1, 2015

⌛ Testing commit f15813d with merge d528aa9...

@bors bors merged commit f15813d into rust-lang:master Apr 1, 2015
@nikomatsakis nikomatsakis deleted the closure-region-hierarchy branch March 30, 2016 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants