]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrowck-loan-vec-content.stderr
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / borrowck / borrowck-loan-vec-content.stderr
1 error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable
2   --> $DIR/borrowck-loan-vec-content.rs:18:9
3    |
4 LL |     takes_imm_elt(
5    |     ------------- immutable borrow later used by call
6 LL |         &v[0],
7    |          - immutable borrow occurs here
8 LL |         || {
9    |         ^^ mutable borrow occurs here
10 LL |             v[1] = 4;
11    |             - second borrow occurs due to use of `v` in closure
12
13 error: aborting due to previous error
14
15 For more information about this error, try `rustc --explain E0502`.