]> git.proxmox.com Git - rustc.git/blob - tests/ui/borrowck/borrowck-loan-rcvr.stderr
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / borrowck / borrowck-loan-rcvr.stderr
1 error[E0502]: cannot borrow `p` as mutable because it is also borrowed as immutable
2 --> $DIR/borrowck-loan-rcvr.rs:23:14
3 |
4 LL | p.blockm(|| {
5 | - ------ ^^ mutable borrow occurs here
6 | | |
7 | _____| immutable borrow later used by call
8 | |
9 LL | | p.x = 10;
10 | | --- second borrow occurs due to use of `p` in closure
11 LL | | })
12 | |______- immutable borrow occurs here
13
14 error[E0502]: cannot borrow `p` as immutable because it is also borrowed as mutable
15 --> $DIR/borrowck-loan-rcvr.rs:34:5
16 |
17 LL | let l = &mut p;
18 | ------ mutable borrow occurs here
19 LL | p.impurem();
20 | ^^^^^^^^^^^ immutable borrow occurs here
21 LL |
22 LL | l.x += 1;
23 | -------- mutable borrow later used here
24
25 error: aborting due to 2 previous errors
26
27 For more information about this error, try `rustc --explain E0502`.