about summary refs log tree commit diff
path: root/tests/ui/suggestions/suggest-split-at-mut.stderr
blob: 4502ec1f393baf469ae870414e795bef2358ab37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
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: use `.split_at_mut(position)` to obtain two mutable non-overlapping sub-slices

error[E0499]: cannot borrow `foo` as mutable more than once at a time
  --> $DIR/suggest-split-at-mut.rs:13:18
   |
LL |     let a = &mut foo[..2];
   |                  --- first mutable borrow occurs here
LL |     let b = &mut foo[2..];
   |                  ^^^ second mutable borrow occurs here
LL |     a[0] = 5;
   |     ---- first borrow later used here
   |
   = help: use `.split_at_mut(position)` to obtain two mutable non-overlapping sub-slices

error[E0502]: cannot borrow `foo` as mutable because it is also borrowed as immutable
  --> $DIR/suggest-split-at-mut.rs:22:18
   |
LL |     let a = &foo[..2];
   |              --- immutable borrow occurs here
LL |     let b = &mut foo[2..];
   |                  ^^^ mutable borrow occurs here
LL |     b[0] = 6;
LL |     println!("{:?} {:?}", a, b);
   |                           - immutable borrow later used here
   |
   = help: use `.split_at_mut(position)` to obtain two mutable non-overlapping sub-slices

error[E0502]: cannot borrow `foo` as immutable because it is also borrowed as mutable
  --> $DIR/suggest-split-at-mut.rs:30:14
   |
LL |     let a = &mut foo[..2];
   |                  --- mutable borrow occurs here
LL |     let b = &foo[2..];
   |              ^^^ immutable borrow occurs here
LL |     a[0] = 5;
   |     ---- mutable borrow later used here
   |
   = help: use `.split_at_mut(position)` to obtain two mutable non-overlapping sub-slices

error[E0502]: cannot borrow `foo[_]` as mutable because it is also borrowed as immutable
  --> $DIR/suggest-split-at-mut.rs:38:13
   |
LL |     let a = &foo[1];
   |             ------- immutable borrow occurs here
LL |     let b = &mut foo[2];
   |             ^^^^^^^^^^^ mutable borrow occurs here
LL |     *b = 6;
LL |     println!("{:?} {:?}", a, b);
   |                           - immutable borrow later used here
   |
   = help: use `.split_at_mut(position)` to obtain two mutable non-overlapping sub-slices

error[E0502]: cannot borrow `foo[_]` as immutable because it is also borrowed as mutable
  --> $DIR/suggest-split-at-mut.rs:46:13
   |
LL |     let a = &mut foo[1];
   |             ----------- mutable borrow occurs here
LL |     let b = &foo[2];
   |             ^^^^^^^ immutable borrow occurs here
LL |     *a = 5;
   |     ------ mutable borrow later used here
   |
   = help: use `.split_at_mut(position)` to obtain two mutable non-overlapping sub-slices

error[E0502]: cannot borrow `foo` as immutable because it is also borrowed as mutable
  --> $DIR/suggest-split-at-mut.rs:54:14
   |
LL |     let a = &mut foo[0..];
   |                  --- mutable borrow occurs here
LL |     let b = &foo[0..];
   |              ^^^ immutable borrow occurs here
LL |     a[0] = 5;
   |     ---- mutable borrow later used here

error: aborting due to 7 previous errors

Some errors have detailed explanations: E0499, E0502.
For more information about an error, try `rustc --explain E0499`.