Uh oh!
There was an error while loading. Please reload this page.
Issue #46589 - Kill borrows on a local variable whenever we assign ov… - #46752
Conversation
rust-highfive
commented
Dec 15, 2017
r? @pnkfelix (rust_highfive has picked a reviewer for you, use r? to override) |
bjorn3
commented
Dec 16, 2017
Issue #46589 (just to link it) Could you add a test? |
pnkfelix
commented
Dec 16, 2017
The code looks fine to me; just add a test and we should be good. |
I have added the test of issue #46589 and much to my surprise, it still fails, although it looks like it should be covered by my patch. I must be missing something obvious: error[E0506]: cannot assign to `list` because it is borrowed
--> /Users/david/Documents/Code/rust-nll/src/test/run-pass/nll-iterating-and-updating.rs:25:13
|
23 | result.push(&mut list.value);
| --------------- borrow of `list` occurs here
24 | ifletSome(n) = list.next.as_mut(){25 | list = n;
| ^^^^^^^^ assignment to borrowed `list` occurs here
error:aborting due to previous error |
Note: problem appears even if we add a letmut list = list;so it's probably not caused by |
I think that's because you haven't fixed this: rust/src/librustc_mir/borrow_check/mod.rs Lines 335 to 355 in a9f047c |
Yoric
commented
Dec 19, 2017
Ok, thanks to @arielb1, this now seems to work. |
a96ad49 to
5e0e633CompareYoric
commented
Dec 19, 2017
(oops, forgot to remove the obsolete test, this should now be fixed) |
arielb1
commented
Dec 19, 2017
@bors r+ |
bors
commented
Dec 19, 2017
📌 Commit 5e0e633 has been approved by |
bors
commented
Dec 20, 2017
⌛ Testing commit 5e0e633d1f780f865b4c8298f7116b274824994a with merge 627022b2338aeb9e7d416bb1c6fee34125d8ec32... |
bors
commented
Dec 20, 2017
💔 Test failed - status-appveyor |
Yoric
commented
Dec 21, 2017
As far as I can tell, the single failure is a timeout, which I imagine is not caused by this PR. |
@bors retry — 3 hour timeout. Details
|
Yoric
commented
Dec 21, 2017
Fwiw, |
bors
commented
Dec 21, 2017
☔ The latest upstream changes (presumably #46904) made this pull request unmergeable. Please resolve the merge conflicts. |
…assign over this variable
kennytm
commented
Dec 21, 2017
@bors r=arielb1 |
bors
commented
Dec 21, 2017
📌 Commit fcb1090 has been approved by |
bors
commented
Dec 22, 2017
Issue #46589 - Kill borrows on a local variable whenever we assign ov… …er this variable This is a first patch for the issue, handling the simple case while I figure out the data structures involved in the more complex cases.
bors
commented
Dec 22, 2017
☀️ Test successful - status-appveyor, status-travis |
…er this variable
This is a first patch for the issue, handling the simple case while I figure out the data structures involved in the more complex cases.