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