]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrowck-bad-nested-calls-free.stderr
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / borrowck / borrowck-bad-nested-calls-free.stderr
1 error[E0502]: cannot borrow `a` as mutable because it is also borrowed as immutable
2   --> $DIR/borrowck-bad-nested-calls-free.rs:25:17
3    |
4 LL |     add(
5    |     --- immutable borrow later used by call
6 LL |         &*a,
7    |         --- immutable borrow occurs here
8 LL |         rewrite(&mut a));
9    |                 ^^^^^^ mutable borrow occurs here
10
11 error[E0502]: cannot borrow `a` as mutable because it is also borrowed as immutable
12   --> $DIR/borrowck-bad-nested-calls-free.rs:32:17
13    |
14 LL |     add(
15    |     --- immutable borrow later used by call
16 LL |         &*a,
17    |         --- immutable borrow occurs here
18 LL |         rewrite(&mut a));
19    |                 ^^^^^^ mutable borrow occurs here
20
21 error: aborting due to 2 previous errors
22
23 For more information about this error, try `rustc --explain E0502`.