Uh oh!
There was an error while loading. Please reload this page.
MIR-borrowck: immutable unique closure upvars can be mutated - #46236
Conversation
rust-highfive
commented
Nov 24, 2017
r? @pnkfelix (rust_highfive has picked a reviewer for you, use r? to override) |
This isn't quite working yet and I'm not quite sure why. I think I've followed the instructions left on the issue correctly. |
There was a problem hiding this comment.
nit: rename it to pub capture_mode: Option<BorrowKind>?
There was a problem hiding this comment.
nit: if let Some(BorrowKind::Unique) = decl.by_ref {
I think you also need to change |
davidtwco
commented
Nov 26, 2017
There was a problem hiding this comment.
You still need the move_path_closest_to change here. Also, for assignments you want to move_path_closest_to the original lvalue, not the result of is_mutable, in order to allow
fnmain(){let x:(u32,u32);
x.0 = 0;
x.1 = 1;}arielb1
commented
Nov 27, 2017
BTW, if you're already at this, you could also fix #46160 by marking the closure argument (argument |
davidtwco
commented
Nov 27, 2017
bors
commented
Nov 30, 2017
☔ The latest upstream changes (presumably #46041) made this pull request unmergeable. Please resolve the merge conflicts. |
davidtwco
commented
Nov 30, 2017
Pushed a compiling version of the last changes and rebased ontop of the current master. Wasn't sure what to use for the new parameter to |
arielb1
commented
Nov 30, 2017
@bors r+ |
bors
commented
Nov 30, 2017
📌 Commit c6b1ba5 has been approved by |
bors
commented
Dec 1, 2017
MIR-borrowck: immutable unique closure upvars can be mutated Fixes#46023 and #46160 (see [this comment](#46236 (comment))).
bors
commented
Dec 1, 2017
☀️ Test successful - status-appveyor, status-travis |
eddyb
commented
May 16, 2018
This should have been merged like this, |
nikomatsakis
commented
May 16, 2018
Hmm. Maybe, but I'm not sure. I guess it depends on how you view the (On the other hand, maybe it's nice to have all the upvar information collected in one place...) ( <grumpy> I still think we should just drop the notion of declaring local variables as |
Fixes#46023 and #46160 (see this comment).