2018-08-08 07:28:26 -05:00
|
|
|
error[E0502]: cannot borrow `s` as immutable because it is also borrowed as mutable
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/borrowck-overloaded-index-ref-index.rs:52:22
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
|
LL | let rs = &mut s;
|
|
|
|
| ------ mutable borrow occurs here
|
|
|
|
LL | println!("{}", f[&s]);
|
|
|
|
| ^^ immutable borrow occurs here
|
|
|
|
...
|
|
|
|
LL | drop(rs);
|
2018-09-29 05:47:47 -05:00
|
|
|
| -- mutable borrow later used here
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
error[E0502]: cannot borrow `s` as immutable because it is also borrowed as mutable
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/borrowck-overloaded-index-ref-index.rs:55:7
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
|
LL | let rs = &mut s;
|
|
|
|
| ------ mutable borrow occurs here
|
|
|
|
...
|
|
|
|
LL | f[&s] = 10;
|
|
|
|
| ^^ immutable borrow occurs here
|
|
|
|
...
|
|
|
|
LL | drop(rs);
|
2018-09-29 05:47:47 -05:00
|
|
|
| -- mutable borrow later used here
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
error[E0594]: cannot assign to data in a `&` reference
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/borrowck-overloaded-index-ref-index.rs:61:5
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
|
LL | s[2] = 20;
|
|
|
|
| ^^^^^^^^^ cannot assign
|
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
|
2019-04-17 12:26:38 -05:00
|
|
|
For more information about this error, try `rustc --explain E0502`.
|