blob: 22c72af61d625e5f123fc3a55d3e4fc671c03ad9 (
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
|
error[E0499]: cannot borrow `data` as mutable more than once at a time
--> $DIR/loan_ends_mid_block_vec.rs:11:5
|
LL | let slice = &mut data;
| --------- first mutable borrow occurs here
LL | capitalize(slice);
LL | data.push('d');
| ^^^^^^^^^^^^^^ second mutable borrow occurs here
...
LL | capitalize(slice);
| ----- first borrow later used here
error[E0499]: cannot borrow `data` as mutable more than once at a time
--> $DIR/loan_ends_mid_block_vec.rs:13:5
|
LL | let slice = &mut data;
| --------- first mutable borrow occurs here
...
LL | data.push('e');
| ^^^^^^^^^^^^^^ second mutable borrow occurs here
...
LL | capitalize(slice);
| ----- first borrow later used here
error[E0499]: cannot borrow `data` as mutable more than once at a time
--> $DIR/loan_ends_mid_block_vec.rs:15:5
|
LL | let slice = &mut data;
| --------- first mutable borrow occurs here
...
LL | data.push('f');
| ^^^^^^^^^^^^^^ second mutable borrow occurs here
LL |
LL | capitalize(slice);
| ----- first borrow later used here
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0499`.
|