[NLL] store a value for each region #44870
Labels
E-mentor
Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Uh oh!
There was an error while loading. Please reload this page.
The NLL code currently contains code to renumber all regions into fresh region variables, but it contains no map storing the value of those region variables.
We should define a struct
Region
that will store the value of a non-lexical region. This struct would resembleRegion
from the NLL prototype and basically play the same role. I think it can initially look something like this:The
Location
struct is defined inlibrustc/mir
and it is basically a "point" -- basic block + statement index.Then we should add to the
NLLVisitor
struct a field likeregion_values: Vec<Region>
. Each time that we create a new region variable, we will also push aRegion::default()
onto the vector to serve as its (initially empty) value.Eventually, this struct will also want to contain free regions. but I figure we can start without them, while we debate how best to represent free regions here. (Probably
ty::Region<'tcx>
for now, but I think we can ignore it for now and just target "intra-function" cases.)The text was updated successfully, but these errors were encountered: