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