Skip to content
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

Transition the compiler arenas #61838

Closed
4 tasks done
nikomatsakis opened this issue Jun 14, 2019 · 1 comment
Closed
4 tasks done

Transition the compiler arenas #61838

nikomatsakis opened this issue Jun 14, 2019 · 1 comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@nikomatsakis
Copy link
Contributor

nikomatsakis commented Jun 14, 2019

We are in the midst of simplifying the compiler's lifetime system. In general, this means that TyCtxt<'a, 'gcx, 'tcx> is going to become just TyCtxt<'tcx>, where 'tcx represents the lifetime of the entire compilation (we no longer have global and local arenas).

Implementation plan

If your PR is affected

Once #61817 lands, what you want to do is generally rewrite to TyCtxt<'tcx> or -- less often -- TyCtxt<'_>. More specifically, you can convert older code by pattern matching like so:

  • TyCtxt<_, 'tcx, _> becomes TyCtxt<'tcx>
  • TyCtxt<'_, '_, 'tcx> becomes TyCtxt<'tcx>

You can also handle any unused lifetime warnings by replacing the unused lifetime with '_.

Note: when adapting your code, you should never need to introduce a new lifetime, you're only removing them. If you find yourself adding a 'gcx to some impl, that's wrong =)

@nikomatsakis nikomatsakis added C-cleanup Category: PRs that clean code up or issues documenting cleanup. C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 14, 2019
@Mark-Simulacrum
Copy link
Member

I'm going to close this bug since we've completed all the items on it, feel free to reopen if there's something additional to keep track of here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants