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