rust/src/test/ui/nll/drop-no-may-dangle.stderr

27 lines
1.1 KiB
Plaintext
Raw Normal View History

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] };
| ----- 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
| ^^^^^^^^^ assignment to borrowed `v[..]` occurs here
...
2018-02-22 18:42:32 -06:00
LL | }
| - borrow later used here, when `p` is dropped
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] };
| ----- 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
| ^^^^^^^^^ assignment to borrowed `v[..]` occurs here
2018-02-22 18:42:32 -06:00
LL | }
| - borrow later used here, when `p` is dropped
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"