]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-loan-rcvr.stderr
Rollup merge of #82259 - osa1:issue82156, r=petrochenkov
[rust.git] / src / test / 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    |     immutable borrow occurs here
9 LL |         p.x = 10;
10    |         - second borrow occurs due to use of `p` in closure
11
12 error[E0502]: cannot borrow `p` as immutable because it is also borrowed as mutable
13   --> $DIR/borrowck-loan-rcvr.rs:34:5
14    |
15 LL |     let l = &mut p;
16    |             ------ mutable borrow occurs here
17 LL |     p.impurem();
18    |     ^ immutable borrow occurs here
19 LL | 
20 LL |     l.x += 1;
21    |     -------- mutable borrow later used here
22
23 error: aborting due to 2 previous errors
24
25 For more information about this error, try `rustc --explain E0502`.