-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Closure region hierarchy #23109
Conversation
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 |
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.
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.)
@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.)
1411d06
to
f15813d
Compare
Adjust internal treatment of the region hierarchy around closures. Work towards #3696.
r? @pnkfelix