You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MIR Borrowck does not handle borrows of array elements #45537
Mr-Darcy. rustc +nightly -Zborrowck-mir region-liveness-basic.rs
error[E0506]: cannot assign to `v[..]` because it is borrowed (Ast)
--> region-liveness-basic.rs:32:5
|
26 | let p = &v[0];
| ---- borrow of `v[..]` occurs here
...
32 | v[0] += 1;
| ^^^^^^^^^ assignment to borrowed `v[..]` occurs here
error: aborting due to previous error
Not sure what is going on, but if -Zborrowck-mir is not passed, the error output is
error[E0506]: cannot assign to `v[..]` because it is borrowed
--> foo.rs:15:5
|
9 | let p = &v[0];
| ---- borrow of `v[..]` occurs here
...
15 | v[0] += 1;
| ^^^^^^^^^ assignment to borrowed `v[..]` occurs here
error[E0506]: cannot assign to `v` because it is borrowed (Mir)
--> foo.rs:16:2
|
9 | let p = &v[0];
| ----- borrow of `v` occurs here
...
16 | }
| ^ assignment to borrowed `v` occurs here
error: aborting due to 2 previous errors
Activity
nikomatsakis commentedon Oct 25, 2017
I get:
oli-obk commentedon Oct 26, 2017
Not sure what is going on, but if
-Zborrowck-miris not passed, the error output isAuto merge of #46268 - arielb1:union-borrow, r=nikomatsakis