Skip to content

Compute NLL loan scopes using the polonius model#113218

Merged
bors merged 7 commits intorust-lang:masterfrom
lqd:polonius-scopes
Oct 11, 2023
Merged

Compute NLL loan scopes using the polonius model#113218
bors merged 7 commits intorust-lang:masterfrom
lqd:polonius-scopes

Conversation

@lqd
Copy link
Member

@lqd lqd commented Jun 30, 2023

For a location-insensitive analysis (that is, without expressiveness improvements for users yet), this PR implements loans going out of scope using reachability and liveness, rather than checking if the issuing region's values contain a given CFG point. This is equivalent to NLL scopes and computes the same data.

r? @matthewjasper

A couple of notes:

  • there are some assumptions about SCC representatives, placeholders, free regions, and member constraints that I believe hold, and they're documented in the code
  • this passes all the UI tests with -Zpolonius=next -- the perf is not terrible and there are a bunch of ways to improve it in the future.
  • there's a fixme left, hopefully Matthew you know a clean way to get the information it mentions.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants