fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.1 KiB26 linesraw
1error[E0506]: cannot assign to `v[_]` because it is borrowed
2  --> $DIR/drop-no-may-dangle.rs:18:9
3   |
4LL |     let p: WrapMayNotDangle<&usize> = WrapMayNotDangle { value: &v[0] };
5   |                                                                 ----- `v[_]` is borrowed here
6...
7LL |         v[0] += 1;
8   |         ^^^^^^^^^ `v[_]` is assigned to here but it was already borrowed
9...
10LL | }
11   | - borrow might be used here, when `p` is dropped and runs the `Drop` code for type `WrapMayNotDangle`
12
13error[E0506]: cannot assign to `v[_]` because it is borrowed
14  --> $DIR/drop-no-may-dangle.rs:21:5
15   |
16LL |     let p: WrapMayNotDangle<&usize> = WrapMayNotDangle { value: &v[0] };
17   |                                                                 ----- `v[_]` is borrowed here
18...
19LL |     v[0] += 1;
20   |     ^^^^^^^^^ `v[_]` is assigned to here but it was already borrowed
21LL | }
22   | - borrow might be used here, when `p` is dropped and runs the `Drop` code for type `WrapMayNotDangle`
23
24error: aborting due to 2 previous errors
25
26For more information about this error, try `rustc --explain E0506`.