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