]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/loan_ends_mid_block_vec.stderr
Rollup merge of #103644 - catlee:catlee/option-question-mark-docs, r=workingjubilee
[rust.git] / src / test / ui / nll / loan_ends_mid_block_vec.stderr
1 error[E0499]: cannot borrow `data` as mutable more than once at a time
2   --> $DIR/loan_ends_mid_block_vec.rs:11:5
3    |
4 LL |     let slice = &mut data;
5    |                 --------- first mutable borrow occurs here
6 LL |     capitalize(slice);
7 LL |     data.push('d');
8    |     ^^^^^^^^^^^^^^ second mutable borrow occurs here
9 ...
10 LL |     capitalize(slice);
11    |                ----- first borrow later used here
12
13 error[E0499]: cannot borrow `data` as mutable more than once at a time
14   --> $DIR/loan_ends_mid_block_vec.rs:13:5
15    |
16 LL |     let slice = &mut data;
17    |                 --------- first mutable borrow occurs here
18 ...
19 LL |     data.push('e');
20    |     ^^^^^^^^^^^^^^ second mutable borrow occurs here
21 ...
22 LL |     capitalize(slice);
23    |                ----- first borrow later used here
24
25 error[E0499]: cannot borrow `data` as mutable more than once at a time
26   --> $DIR/loan_ends_mid_block_vec.rs:15:5
27    |
28 LL |     let slice = &mut data;
29    |                 --------- first mutable borrow occurs here
30 ...
31 LL |     data.push('f');
32    |     ^^^^^^^^^^^^^^ second mutable borrow occurs here
33 LL |
34 LL |     capitalize(slice);
35    |                ----- first borrow later used here
36
37 error: aborting due to 3 previous errors
38
39 For more information about this error, try `rustc --explain E0499`.