-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
[NLL] store a value for each region #44870
Copy link
Copy link
Closed
Labels
E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
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
Regionthat will store the value of a non-lexical region. This struct would resembleRegionfrom the NLL prototype and basically play the same role. I think it can initially look something like this:The
Locationstruct is defined inlibrustc/mirand it is basically a "point" -- basic block + statement index.Then we should add to the
NLLVisitorstruct 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.)