]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-loan-rcvr.stderr
Auto merge of #54624 - arielb1:evaluate-outlives, r=nikomatsakis
[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:34:14
3    |
4 LL |     p.blockm(|| { //~ ERROR cannot borrow `p` as mutable
5    |     -        ^^ mutable borrow occurs here
6    |     |
7    |     immutable borrow occurs here
8 LL |         p.x = 10;
9    |         - borrow occurs due to use of `p` in closure
10 LL |     })
11    |      - immutable borrow ends here
12
13 error[E0502]: cannot borrow `p` as immutable because it is also borrowed as mutable
14   --> $DIR/borrowck-loan-rcvr.rs:45:5
15    |
16 LL |     let l = &mut p;
17    |                  - mutable borrow occurs here
18 LL |     p.impurem(); //~ ERROR cannot borrow
19    |     ^ immutable borrow occurs here
20 ...
21 LL | }
22    | - mutable borrow ends here
23
24 error: aborting due to 2 previous errors
25
26 For more information about this error, try `rustc --explain E0502`.