1 error[E0502]: cannot borrow `*f` as immutable because it is also borrowed as mutable
2 --> $DIR/borrowck-overloaded-index-autoderef.rs:47:14
4 LL | let p = &mut f[&s];
5 | - mutable borrow occurs here
6 LL | let q = &f[&s]; //~ ERROR cannot borrow
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:53:18
14 LL | let p = &mut f[&s];
15 | - first mutable borrow occurs here
16 LL | let q = &mut f[&s]; //~ ERROR cannot borrow
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:63:18
24 LL | let p = &mut f.foo[&s];
25 | ----- first mutable borrow occurs here
26 LL | let q = &mut f.foo[&s]; //~ ERROR cannot borrow
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:75:18
34 LL | let p = &f.foo[&s];
35 | ----- immutable borrow occurs here
36 LL | let q = &mut f.foo[&s]; //~ ERROR cannot borrow
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:81:5
44 LL | let p = &f.foo[&s];
45 | ----- borrow of `f.foo` occurs here
46 LL | f.foo = g; //~ ERROR cannot assign
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:87:5
54 LL | let p = &f.foo[&s];
55 | ----- borrow of `*f` occurs here
56 LL | *f = g; //~ ERROR cannot assign
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:93:5
64 LL | let p = &mut f.foo[&s];
65 | ----- borrow of `f.foo` occurs here
66 LL | f.foo = g; //~ ERROR cannot assign
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:99:5
74 LL | let p = &mut f.foo[&s];
75 | ----- borrow of `*f` occurs here
76 LL | *f = g; //~ ERROR cannot assign
77 | ^^^^^^ assignment to borrowed `*f` occurs here
79 | - borrow later used here
81 error: aborting due to 8 previous errors
83 Some errors occurred: E0499, E0502, E0506.
84 For more information about an error, try `rustc --explain E0499`.