]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-loan-vec-content.nll.stderr
Auto merge of #54624 - arielb1:evaluate-outlives, r=nikomatsakis
[rust.git] / src / test / ui / borrowck / borrowck-loan-vec-content.nll.stderr
1 error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable
2   --> $DIR/borrowck-loan-vec-content.rs:28:9
3    |
4 LL | /     takes_imm_elt(
5 LL | |         &v[0],
6    | |          - immutable borrow occurs here
7 LL | |         || { //~ ERROR cannot borrow `v` as mutable
8    | |         ^^ mutable borrow occurs here
9 LL | |             v[1] = 4;
10    | |             - second borrow occurs due to use of `v` in closure
11 LL | |         })
12    | |__________- borrow later used here
13
14 error: aborting due to previous error
15
16 For more information about this error, try `rustc --explain E0502`.