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

Comments

Projects
None yet
2 participants
@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

This comment has been minimized.

Copy link
Contributor Author

nikomatsakis commented Nov 16, 2017

@pnkfelix may tackle this.

@pnkfelix pnkfelix self-assigned this Nov 17, 2017

@nikomatsakis

This comment has been minimized.

Copy link
Contributor Author

nikomatsakis commented Dec 12, 2017

PR: #46537

@nikomatsakis

This comment has been minimized.

Copy link
Contributor Author

nikomatsakis commented Jan 3, 2018

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
You can’t perform that action at this time.