2017-12-20 10:20:07 -06:00
|
|
|
error[E0506]: cannot assign to `v[..]` because it is borrowed
|
|
|
|
--> $DIR/drop-no-may-dangle.rs:31:9
|
|
|
|
|
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | let p: WrapMayNotDangle<&usize> = WrapMayNotDangle { value: &v[0] };
|
2017-12-20 10:20:07 -06:00
|
|
|
| ----- borrow of `v[..]` occurs here
|
|
|
|
...
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | v[0] += 1; //~ ERROR cannot assign to `v[..]` because it is borrowed
|
2017-12-20 10:20:07 -06:00
|
|
|
| ^^^^^^^^^ assignment to borrowed `v[..]` occurs here
|
|
|
|
...
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | }
|
2018-01-13 17:28:00 -06:00
|
|
|
| - borrow later used here, when `p` is dropped
|
2017-12-20 10:20:07 -06:00
|
|
|
|
|
|
|
error[E0506]: cannot assign to `v[..]` because it is borrowed
|
|
|
|
--> $DIR/drop-no-may-dangle.rs:34:5
|
|
|
|
|
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | let p: WrapMayNotDangle<&usize> = WrapMayNotDangle { value: &v[0] };
|
2017-12-20 10:20:07 -06:00
|
|
|
| ----- borrow of `v[..]` occurs here
|
|
|
|
...
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | v[0] += 1; //~ ERROR cannot assign to `v[..]` because it is borrowed
|
2017-12-20 10:20:07 -06:00
|
|
|
| ^^^^^^^^^ assignment to borrowed `v[..]` occurs here
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | }
|
2018-01-13 17:28:00 -06:00
|
|
|
| - borrow later used here, when `p` is dropped
|
2017-12-20 10:20:07 -06:00
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|
2018-02-19 14:40:25 -06:00
|
|
|
If you want more information on this error, try using "rustc --explain E0506"
|