1 error[E0499]: cannot borrow `*x` as mutable more than once at a time
2 --> $DIR/coerce-overloaded-autoderef.rs:22: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 | - borrow later used here
12 error[E0506]: cannot assign to `**x` because it is borrowed
13 --> $DIR/coerce-overloaded-autoderef.rs:31:5
15 LL | let y = borrow(x);
16 | - borrow of `**x` occurs here
17 LL | let z = borrow(x);
19 | ^^^^^^^^ assignment to borrowed `**x` occurs here
22 | - borrow later used here
24 error[E0499]: cannot borrow `*x` as mutable more than once at a time
25 --> $DIR/coerce-overloaded-autoderef.rs:38:20
27 LL | borrow_mut2(x, x);
30 | | | second mutable borrow occurs here
31 | | first mutable borrow occurs here
32 | borrow later used here
34 error[E0502]: cannot borrow `*x` as immutable because it is also borrowed as mutable
35 --> $DIR/coerce-overloaded-autoderef.rs:44:16
40 | | | immutable borrow occurs here
41 | | mutable borrow occurs here
42 | borrow later used here
44 error: aborting due to 4 previous errors
46 Some errors occurred: E0499, E0502, E0506.
47 For more information about an error, try `rustc --explain E0499`.