]> git.proxmox.com Git - rustc.git/blob - tests/ui/borrowck/borrowck-loan-rcvr-overloaded-op.stderr
24cc4933ef1b055efa4cf821bb90816c98ce1e46
[rustc.git] / tests / ui / borrowck / borrowck-loan-rcvr-overloaded-op.stderr
1 error[E0503]: cannot use `p` because it was mutably borrowed
2 --> $DIR/borrowck-loan-rcvr-overloaded-op.rs:38:5
3 |
4 LL | let q = &mut p;
5 | ------ borrow of `p` occurs here
6 LL |
7 LL | p + 3;
8 | ^ use of borrowed `p`
9 ...
10 LL | *q + 3; // OK to use the new alias `q`
11 | -- borrow later used here
12
13 error[E0502]: cannot borrow `p` as immutable because it is also borrowed as mutable
14 --> $DIR/borrowck-loan-rcvr-overloaded-op.rs:39:5
15 |
16 LL | let q = &mut p;
17 | ------ mutable borrow occurs here
18 ...
19 LL | p.times(3);
20 | ^^^^^^^^^^ immutable borrow occurs here
21 LL |
22 LL | *q + 3; // OK to use the new alias `q`
23 | -- mutable borrow later used here
24
25 error: aborting due to 2 previous errors
26
27 Some errors have detailed explanations: E0502, E0503.
28 For more information about an error, try `rustc --explain E0502`.