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