]> git.proxmox.com Git - rustc.git/blame - src/test/ui/nll/drop-no-may-dangle.stderr
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / nll / drop-no-may-dangle.stderr
CommitLineData
0731742a 1error[E0506]: cannot assign to `v[_]` because it is borrowed
923072b8 2 --> $DIR/drop-no-may-dangle.rs:18:9
ff7c6d11 3 |
0531ce1d 4LL | let p: WrapMayNotDangle<&usize> = WrapMayNotDangle { value: &v[0] };
0731742a 5 | ----- borrow of `v[_]` occurs here
ff7c6d11 6...
532ac7d7 7LL | v[0] += 1;
0731742a 8 | ^^^^^^^^^ assignment to borrowed `v[_]` occurs here
ff7c6d11 9...
0531ce1d 10LL | }
0bf4aa26 11 | - borrow might be used here, when `p` is dropped and runs the `Drop` code for type `WrapMayNotDangle`
ff7c6d11 12
0731742a 13error[E0506]: cannot assign to `v[_]` because it is borrowed
923072b8 14 --> $DIR/drop-no-may-dangle.rs:21:5
ff7c6d11 15 |
0531ce1d 16LL | let p: WrapMayNotDangle<&usize> = WrapMayNotDangle { value: &v[0] };
0731742a 17 | ----- borrow of `v[_]` occurs here
ff7c6d11 18...
532ac7d7 19LL | v[0] += 1;
0731742a 20 | ^^^^^^^^^ assignment to borrowed `v[_]` occurs here
0531ce1d 21LL | }
0bf4aa26 22 | - borrow might be used here, when `p` is dropped and runs the `Drop` code for type `WrapMayNotDangle`
ff7c6d11
XL
23
24error: aborting due to 2 previous errors
25
0531ce1d 26For more information about this error, try `rustc --explain E0506`.