34 lines
1.0 KiB
Plaintext
34 lines
1.0 KiB
Plaintext
|
error[E0505]: cannot move out of `s` because it is borrowed
|
||
|
--> $DIR/borrowck-overloaded-index-move-index.rs:60:22
|
||
|
|
|
||
|
LL | let rs = &mut s;
|
||
|
| - borrow of `s` occurs here
|
||
|
LL |
|
||
|
LL | println!("{}", f[s]);
|
||
|
| ^ move out of `s` occurs here
|
||
|
|
||
|
error[E0505]: cannot move out of `s` because it is borrowed
|
||
|
--> $DIR/borrowck-overloaded-index-move-index.rs:63:7
|
||
|
|
|
||
|
LL | let rs = &mut s;
|
||
|
| - borrow of `s` occurs here
|
||
|
...
|
||
|
LL | f[s] = 10;
|
||
|
| ^ move out of `s` occurs here
|
||
|
|
||
|
error[E0382]: use of moved value: `s`
|
||
|
--> $DIR/borrowck-overloaded-index-move-index.rs:63:7
|
||
|
|
|
||
|
LL | println!("{}", f[s]);
|
||
|
| - value moved here
|
||
|
...
|
||
|
LL | f[s] = 10;
|
||
|
| ^ value used here after move
|
||
|
|
|
||
|
= note: move occurs because `s` has type `std::string::String`, which does not implement the `Copy` trait
|
||
|
|
||
|
error: aborting due to 3 previous errors
|
||
|
|
||
|
Some errors occurred: E0382, E0505.
|
||
|
For more information about an error, try `rustc --explain E0382`.
|