mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 16:54:01 +00:00
41e8d152dc
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
17 lines
693 B
Plaintext
17 lines
693 B
Plaintext
error[E0499]: cannot borrow `foo[_]` as mutable more than once at a time
|
|
--> $DIR/suggest-split-at-mut.rs:4:13
|
|
|
|
|
LL | let a = &mut foo[2];
|
|
| ----------- first mutable borrow occurs here
|
|
LL | let b = &mut foo[3];
|
|
| ^^^^^^^^^^^ second mutable borrow occurs here
|
|
LL | *a = 5;
|
|
| ------ first borrow later used here
|
|
|
|
|
= help: consider using `.split_at_mut(position)` or similar method to obtain two mutable non-overlapping sub-slices
|
|
= help: consider using `.swap(index_1, index_2)` to swap elements at the specified indices
|
|
|
|
error: aborting due to 1 previous error
|
|
|
|
For more information about this error, try `rustc --explain E0499`.
|