-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Transition the compiler arenas #61838
Copy link
Copy link
Closed
Labels
C-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-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
C-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-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.
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 justTyCtxt<'tcx>, where'tcxrepresents the lifetime of the entire compilation (we no longer have global and local arenas).Implementation plan
TyCtxt<'a, 'gcx, 'tcx>toTyCtxt<'gcx, 'tcx>rustc: replaceTyCtxt<'a, 'gcx, 'tcx>withTyCtxt<'gcx, 'tcx>. #61722TyCtxt<'gcx, 'tcx>toTyCtxt<'tcx>Unify all uses of 'gcx and 'tcx. #61817If 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, _>becomesTyCtxt<'tcx>TyCtxt<'_, '_, 'tcx>becomesTyCtxt<'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
'gcxto some impl, that's wrong =)