rust/tests/ui/nll/loan_ends_mid_block_vec.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 lines
1.3 KiB
Plaintext
Raw Normal View History

2019-05-02 17:34:15 -05:00
error[E0499]: cannot borrow `data` as mutable more than once at a time
--> $DIR/loan_ends_mid_block_vec.rs:11:5
2018-08-08 07:28:26 -05:00
|
LL | let slice = &mut data;
| --------- first mutable borrow occurs here
LL | capitalize(slice);
LL | data.push('d');
2021-09-16 15:01:22 -05:00
| ^^^^^^^^^^^^^^ second mutable borrow occurs here
2018-08-08 07:28:26 -05:00
...
LL | capitalize(slice);
| ----- first borrow later used here
2018-08-08 07:28:26 -05:00
2019-05-02 17:34:15 -05:00
error[E0499]: cannot borrow `data` as mutable more than once at a time
--> $DIR/loan_ends_mid_block_vec.rs:13:5
2018-08-08 07:28:26 -05:00
|
LL | let slice = &mut data;
| --------- first mutable borrow occurs here
...
LL | data.push('e');
2021-09-16 15:01:22 -05:00
| ^^^^^^^^^^^^^^ second mutable borrow occurs here
2018-08-08 07:28:26 -05:00
...
LL | capitalize(slice);
| ----- first borrow later used here
2018-08-08 07:28:26 -05:00
2019-05-02 17:34:15 -05:00
error[E0499]: cannot borrow `data` as mutable more than once at a time
--> $DIR/loan_ends_mid_block_vec.rs:15:5
2018-08-08 07:28:26 -05:00
|
LL | let slice = &mut data;
| --------- first mutable borrow occurs here
...
LL | data.push('f');
2021-09-16 15:01:22 -05:00
| ^^^^^^^^^^^^^^ second mutable borrow occurs here
2019-05-02 17:34:15 -05:00
LL |
2018-08-08 07:28:26 -05:00
LL | capitalize(slice);
| ----- first borrow later used here
2018-08-08 07:28:26 -05:00
2019-05-02 17:34:15 -05:00
error: aborting due to 3 previous errors
2018-08-08 07:28:26 -05:00
For more information about this error, try `rustc --explain E0499`.