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

Allow two-phase borrows of &mut self in ops #48197

Merged
merged 2 commits into from
Feb 25, 2018

Conversation

sapphire-arches
Copy link
Contributor

We need two-phase borrows of ops to be in the initial NLL release since without them lots of existing code will break. Fixes #48129.
CC @pnkfelix and @nikomatsakis

r? @pnkfelix

We need two-phase borrows of ops to be in the initial NLL release since without
them lots of existing code will break. Fixes rust-lang#48129
@sapphire-arches sapphire-arches added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 14, 2018
@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @pnkfelix (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

// except according to those terms.

// revisions: lxl nll
//[lxl]compile-flags: -Z borrowck=mir -Z two-phase-borrows
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this lxl revision is still using the MIR borrowck. Can we add a revision that tests the existing borrowck (possibly replacing the existing lxl)? e.g.

// Test that NLL and the older, AST-based checker both accept these constructions:
// revisions: ast nll

#![cfg_attr(nll, feature(nll))]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I don't know that we care so much about the MIR-based borrowck without NLL enabled)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, but now I'm really confused about the arguments specified here

//[lxl]compile-flags: -Z borrowck=mir -Z two-phase-borrows

In any case, I've dropped those args now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I think that felix was specifically targeting MIR borrowck w/o NLL. But in this case, I don't think we need to, but I think it's important to show that we are preserving the current behavior in terms of what code is accepted.

@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Feb 15, 2018

📌 Commit 7062955 has been approved by nikomatsakis

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 15, 2018
Manishearth added a commit to Manishearth/rust that referenced this pull request Feb 19, 2018
…, r=nikomatsakis

Allow two-phase borrows of &mut self in ops

We need two-phase borrows of ops to be in the initial NLL release since without them lots of existing code will break. Fixes rust-lang#48129.
CC @pnkfelix  and @nikomatsakis

r? @pnkfelix
Manishearth added a commit to Manishearth/rust that referenced this pull request Feb 20, 2018
bors added a commit that referenced this pull request Feb 20, 2018
Manishearth added a commit to Manishearth/rust that referenced this pull request Feb 24, 2018
…, r=nikomatsakis

Allow two-phase borrows of &mut self in ops

We need two-phase borrows of ops to be in the initial NLL release since without them lots of existing code will break. Fixes rust-lang#48129.
CC @pnkfelix  and @nikomatsakis

r? @pnkfelix
bors added a commit that referenced this pull request Feb 25, 2018
Rollup of 15 pull requests

- Successful merges: #47689, #48110, #48197, #48296, #48386, #48392, #48404, #48415, #48441, #48448, #48452, #48481, #48490, #48499, #48503
- Failed merges:
@bors bors merged commit 7062955 into rust-lang:master Feb 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants