1 error[E0499]: cannot borrow `*x` as mutable more than once at a time
2 --> $DIR/coerce-overloaded-autoderef-fail.rs:9:24
4 LL | let y = borrow_mut(x);
5 | - first mutable borrow occurs here
6 LL | let z = borrow_mut(x);
7 | ^ second mutable borrow occurs here
10 | - first borrow later used here
12 error[E0506]: cannot assign to `**x` because it is borrowed
13 --> $DIR/coerce-overloaded-autoderef-fail.rs:17:5
15 LL | let y = borrow(x);
16 | - `**x` is borrowed here
17 LL | let z = borrow(x);
19 | ^^^^^^^^ `**x` is assigned to here but it was already borrowed
22 | - borrow later used here
24 error[E0499]: cannot borrow `*x` as mutable more than once at a time
25 --> $DIR/coerce-overloaded-autoderef-fail.rs:23:20
27 LL | borrow_mut2(x, x);
28 | ----------- - ^ second mutable borrow occurs here
30 | | first mutable borrow occurs here
31 | first borrow later used by call
33 error[E0502]: cannot borrow `*x` as mutable because it is also borrowed as immutable
34 --> $DIR/coerce-overloaded-autoderef-fail.rs:28:5
39 | | immutable borrow occurs here
40 | mutable borrow occurs here
41 | immutable borrow later used by call
43 error: aborting due to 4 previous errors
45 Some errors have detailed explanations: E0499, E0502, E0506.
46 For more information about an error, try `rustc --explain E0499`.