@@ -8,8 +8,7 @@ LL | let b = &mut foo[3];
88LL | *a = 5;
99 | ------ first borrow later used here
1010 |
11- = help: consider using `.split_at_mut(position)` or similar method to obtain two mutable non-overlapping sub-slices
12- = help: consider using `.swap(index_1, index_2)` to swap elements at the specified indices
11+ = help: use `.split_at_mut(position)` to obtain two mutable non-overlapping sub-slices
1312
1413error[E0499]: cannot borrow `foo` as mutable more than once at a time
1514 --> $DIR/suggest-split-at-mut.rs:13:18
@@ -59,8 +58,7 @@ LL | *b = 6;
5958LL | println!("{:?} {:?}", a, b);
6059 | - immutable borrow later used here
6160 |
62- = help: consider using `.split_at_mut(position)` or similar method to obtain two mutable non-overlapping sub-slices
63- = help: consider using `.swap(index_1, index_2)` to swap elements at the specified indices
61+ = help: use `.split_at_mut(position)` to obtain two mutable non-overlapping sub-slices
6462
6563error[E0502]: cannot borrow `foo[_]` as immutable because it is also borrowed as mutable
6664 --> $DIR/suggest-split-at-mut.rs:46:13
@@ -72,8 +70,7 @@ LL | let b = &foo[2];
7270LL | *a = 5;
7371 | ------ mutable borrow later used here
7472 |
75- = help: consider using `.split_at_mut(position)` or similar method to obtain two mutable non-overlapping sub-slices
76- = help: consider using `.swap(index_1, index_2)` to swap elements at the specified indices
73+ = help: use `.split_at_mut(position)` to obtain two mutable non-overlapping sub-slices
7774
7875error[E0502]: cannot borrow `foo` as immutable because it is also borrowed as mutable
7976 --> $DIR/suggest-split-at-mut.rs:54:14
0 commit comments