summaryrefslogtreecommitdiffstats
path: root/src/test/ui/borrowck/borrowck-bad-nested-calls-free.stderr
blob: e273a778fdad5d614cba07f5531188a807c18c95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
error[E0502]: cannot borrow `a` as mutable because it is also borrowed as immutable
  --> $DIR/borrowck-bad-nested-calls-free.rs:25:17
   |
LL |     add(
   |     --- immutable borrow later used by call
LL |         &*a,
   |         --- immutable borrow occurs here
LL |         rewrite(&mut a));
   |                 ^^^^^^ mutable borrow occurs here

error[E0502]: cannot borrow `a` as mutable because it is also borrowed as immutable
  --> $DIR/borrowck-bad-nested-calls-free.rs:32:17
   |
LL |     add(
   |     --- immutable borrow later used by call
LL |         &*a,
   |         --- immutable borrow occurs here
LL |         rewrite(&mut a));
   |                 ^^^^^^ mutable borrow occurs here

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0502`.