-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Allow two-phase borrows of &mut self in ops #48197
Conversation
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
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 |
There was a problem hiding this comment.
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))]
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
rust/src/test/run-pass/borrowck/two-phase-control-flow-split-before-activation.rs
Line 12 in 3ec5a99
//[lxl]compile-flags: -Z borrowck=mir -Z two-phase-borrows |
In any case, I've dropped those args now.
There was a problem hiding this comment.
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.
@bors r+ |
📌 Commit 7062955 has been approved by |
…, 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
…, r=nikomatsakis Fixes rust-lang#47311. r? @nrc
…, 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
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