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

MIR Borrowck: two-phased borrows #46037

Closed
nikomatsakis opened this issue Nov 16, 2017 · 3 comments
Closed

MIR Borrowck: two-phased borrows #46037

nikomatsakis opened this issue Nov 16, 2017 · 3 comments
Assignees
Labels
T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Milestone

Comments

@nikomatsakis
Copy link
Contributor

nikomatsakis commented Nov 16, 2017

For maximum impact of demo, we should support two-phased borrows. The general strategy here is to do this in borrow check. When we see a suitable &mut borrow (one tricky bit: deciding the set of &mut borrows for which to do this), we want to generate two loans, one of which is the "first phase" (reserved?) loan that acts as a shared borrow. This will be gen'd at the borrow site and killed at the first use of the temporary to which the borrow is assigned. The other loan will be gen'd at that first use site and killed as normal. This is a placeholder issue to ensure it is not forgotten, more description perhaps to come. =)

@nikomatsakis nikomatsakis added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-compiler-nll labels Nov 16, 2017
@nikomatsakis nikomatsakis added this to the NLL prototype milestone Nov 16, 2017
@nikomatsakis
Copy link
Contributor Author

@pnkfelix may tackle this.

@pnkfelix pnkfelix self-assigned this Nov 17, 2017
@nikomatsakis
Copy link
Contributor Author

PR: #46537

@nikomatsakis
Copy link
Contributor Author

This is done (there are follow-up issues, but those are linked elsewhere)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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