1 error[E0499]: cannot borrow `list[_].value` as mutable more than once at a time
2 --> $DIR/issue-62007-assign-const-index.rs:23:21
4 LL | fn to_refs<T>(mut list: [&mut List<T>; 2]) -> Vec<&mut T> {
5 | - let's call the lifetime of this reference `'1`
7 LL | result.push(&mut list[0].value);
8 | ^^^^^^^^^^^^^^^^^^ `list[_].value` was mutably borrowed here in the previous iteration of the loop
11 | ------ returning this value requires that `list[_].value` is borrowed for `'1`
13 error[E0499]: cannot borrow `list[_].next` as mutable more than once at a time
14 --> $DIR/issue-62007-assign-const-index.rs:24:26
16 LL | fn to_refs<T>(mut list: [&mut List<T>; 2]) -> Vec<&mut T> {
17 | - let's call the lifetime of this reference `'1`
19 LL | if let Some(n) = list[0].next.as_mut() {
20 | ^^^^^^^^^^^^^^^^^^^^^
22 | `list[_].next` was mutably borrowed here in the previous iteration of the loop
23 | argument requires that `list[_].next` is borrowed for `'1`
25 error: aborting due to 2 previous errors
27 For more information about this error, try `rustc --explain E0499`.