1 error[E0502]: cannot borrow `*f` as immutable because it is also borrowed as mutable
2 --> $DIR/borrowck-overloaded-index-autoderef.rs:37:14
4 LL | let p = &mut f[&s];
5 | - mutable borrow occurs here
7 | ^ immutable borrow occurs here
9 | ----------- mutable borrow later used here
11 error[E0499]: cannot borrow `*f` as mutable more than once at a time
12 --> $DIR/borrowck-overloaded-index-autoderef.rs:43:18
14 LL | let p = &mut f[&s];
15 | - first mutable borrow occurs here
16 LL | let q = &mut f[&s];
17 | ^ second mutable borrow occurs here
19 | ----------- first borrow later used here
21 error[E0499]: cannot borrow `f.foo` as mutable more than once at a time
22 --> $DIR/borrowck-overloaded-index-autoderef.rs:53:18
24 LL | let p = &mut f.foo[&s];
25 | ----- first mutable borrow occurs here
26 LL | let q = &mut f.foo[&s];
27 | ^^^^^ second mutable borrow occurs here
29 | ----------- first borrow later used here
31 error[E0502]: cannot borrow `f.foo` as mutable because it is also borrowed as immutable
32 --> $DIR/borrowck-overloaded-index-autoderef.rs:65:18
34 LL | let p = &f.foo[&s];
35 | ----- immutable borrow occurs here
36 LL | let q = &mut f.foo[&s];
37 | ^^^^^ mutable borrow occurs here
39 | ----------- immutable borrow later used here
41 error[E0506]: cannot assign to `f.foo` because it is borrowed
42 --> $DIR/borrowck-overloaded-index-autoderef.rs:71:5
44 LL | let p = &f.foo[&s];
45 | ----- borrow of `f.foo` occurs here
47 | ^^^^^^^^^ assignment to borrowed `f.foo` occurs here
49 | ----------- borrow later used here
51 error[E0506]: cannot assign to `*f` because it is borrowed
52 --> $DIR/borrowck-overloaded-index-autoderef.rs:77:5
54 LL | let p = &f.foo[&s];
55 | ----- borrow of `*f` occurs here
57 | ^^^^^^ assignment to borrowed `*f` occurs here
59 | ----------- borrow later used here
61 error[E0506]: cannot assign to `f.foo` because it is borrowed
62 --> $DIR/borrowck-overloaded-index-autoderef.rs:83:5
64 LL | let p = &mut f.foo[&s];
65 | ----- borrow of `f.foo` occurs here
67 | ^^^^^^^^^ assignment to borrowed `f.foo` occurs here
69 | ----------- borrow later used here
71 error[E0506]: cannot assign to `*f` because it is borrowed
72 --> $DIR/borrowck-overloaded-index-autoderef.rs:89:5
74 LL | let p = &mut f.foo[&s];
75 | ----- borrow of `*f` occurs here
77 | ^^^^^^ assignment to borrowed `*f` occurs here
79 | ----------- borrow later used here
81 error: aborting due to 8 previous errors
83 Some errors have detailed explanations: E0499, E0502, E0506.
84 For more information about an error, try `rustc --explain E0499`.