]>
Commit | Line | Data |
---|---|---|
b7449926 XL |
1 | error[E0502]: cannot borrow `s` as immutable because it is also borrowed as mutable |
2 | --> $DIR/borrowck-overloaded-index-ref-index.rs:62:22 | |
3 | | | |
4 | LL | let rs = &mut s; | |
5 | | ------ mutable borrow occurs here | |
6 | LL | println!("{}", f[&s]); | |
7 | | ^^ immutable borrow occurs here | |
8 | ... | |
9 | LL | drop(rs); | |
10 | | -- borrow later used here | |
11 | ||
12 | error[E0502]: cannot borrow `s` as immutable because it is also borrowed as mutable | |
13 | --> $DIR/borrowck-overloaded-index-ref-index.rs:65:7 | |
14 | | | |
15 | LL | let rs = &mut s; | |
16 | | ------ mutable borrow occurs here | |
17 | ... | |
18 | LL | f[&s] = 10; | |
19 | | ^^ immutable borrow occurs here | |
20 | ... | |
21 | LL | drop(rs); | |
22 | | -- borrow later used here | |
23 | ||
24 | error[E0594]: cannot assign to data in a `&` reference | |
25 | --> $DIR/borrowck-overloaded-index-ref-index.rs:71:5 | |
26 | | | |
27 | LL | s[2] = 20; | |
28 | | ^^^^^^^^^ cannot assign | |
29 | ||
30 | error: aborting due to 3 previous errors | |
31 | ||
32 | Some errors occurred: E0502, E0594. | |
33 | For more information about an error, try `rustc --explain E0502`. |