@@ -8,8 +8,7 @@ LL | let b = &mut foo[3];
8
8
LL | *a = 5;
9
9
| ------ first borrow later used here
10
10
|
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
13
12
14
13
error[E0499]: cannot borrow `foo` as mutable more than once at a time
15
14
--> $DIR/suggest-split-at-mut.rs:13:18
@@ -59,8 +58,7 @@ LL | *b = 6;
59
58
LL | println!("{:?} {:?}", a, b);
60
59
| - immutable borrow later used here
61
60
|
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
64
62
65
63
error[E0502]: cannot borrow `foo[_]` as immutable because it is also borrowed as mutable
66
64
--> $DIR/suggest-split-at-mut.rs:46:13
@@ -72,8 +70,7 @@ LL | let b = &foo[2];
72
70
LL | *a = 5;
73
71
| ------ mutable borrow later used here
74
72
|
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
77
74
78
75
error[E0502]: cannot borrow `foo` as immutable because it is also borrowed as mutable
79
76
--> $DIR/suggest-split-at-mut.rs:54:14
0 commit comments