librustc: Replace scope regions with SEME regions. #16996
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SEME is short for "single-entry/multiple-exit".
This patch contains no functional changes, because all intersection and
union operations on SEME regions convert SEME regions to scopes and use
the old scope-based intersection/union logic on those scopes. However,
this patch does take the full generality of SEME regions into account
when computing the gen/kill bits for the data flow analysis used in the
borrow check. Once the correct intersection and union operations land
(possibly using the dominator tree infrastructure), then non-lexical
borrows (issue #6393) will begin to work. Therefore, this patch
establishes most of the groundwork for non-lexical borrows.
Because this patch refactors the AST to index pattern arms (which is
necessary to make non-lexical borrows work in the data flow analysis for
common cases), it can break compiler plugins.
r? @nikomatsakis
f? @zwarich