rust/src/test/ui/nll/drop-no-may-dangle.stderr
Vadim Petrochenkov fa72a81bea Update tests
2019-03-11 23:10:26 +03:00

27 lines
1.1 KiB
Plaintext

error[E0506]: cannot assign to `v[_]` because it is borrowed
--> $DIR/drop-no-may-dangle.rs:20:9
|
LL | let p: WrapMayNotDangle<&usize> = WrapMayNotDangle { value: &v[0] };
| ----- borrow of `v[_]` occurs here
...
LL | v[0] += 1;
| ^^^^^^^^^ assignment to borrowed `v[_]` occurs here
...
LL | }
| - borrow might be used here, when `p` is dropped and runs the `Drop` code for type `WrapMayNotDangle`
error[E0506]: cannot assign to `v[_]` because it is borrowed
--> $DIR/drop-no-may-dangle.rs:23:5
|
LL | let p: WrapMayNotDangle<&usize> = WrapMayNotDangle { value: &v[0] };
| ----- borrow of `v[_]` occurs here
...
LL | v[0] += 1;
| ^^^^^^^^^ assignment to borrowed `v[_]` occurs here
LL | }
| - borrow might be used here, when `p` is dropped and runs the `Drop` code for type `WrapMayNotDangle`
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0506`.