]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-uniq-via-lend.stderr
Rollup merge of #57132 - daxpedda:master, r=steveklabnik
[rust.git] / src / test / ui / borrowck / borrowck-uniq-via-lend.stderr
1 error[E0502]: cannot borrow `*v` as immutable because `v` is also borrowed as mutable
2   --> $DIR/borrowck-uniq-via-lend.rs:36:13
3    |
4 LL |     let w = &mut v;
5    |                  - mutable borrow occurs here
6 LL |     borrow(&*v); //~ ERROR cannot borrow `*v`
7    |             ^^ immutable borrow occurs here
8 LL |     w.use_mut();
9 LL | }
10    | - mutable borrow ends here
11
12 error[E0502]: cannot borrow `*v` as immutable because `v` is also borrowed as mutable
13   --> $DIR/borrowck-uniq-via-lend.rs:53:13
14    |
15 LL |     x = &mut v;
16    |              - mutable borrow occurs here
17 LL |     borrow(&*v); //~ ERROR cannot borrow `*v`
18    |             ^^ immutable borrow occurs here
19 LL |     x.use_mut();
20 LL | }
21    | - mutable borrow ends here
22
23 error: aborting due to 2 previous errors
24
25 For more information about this error, try `rustc --explain E0502`.