]>
Commit | Line | Data |
---|---|---|
dc9dc135 XL |
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 | |
3 | | | |
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` | |
6 | ... | |
7 | LL | result.push(&mut list[0].value); | |
fc512014 | 8 | | ^^^^^^^^^^^^^^^^^^ `list[_].value` was mutably borrowed here in the previous iteration of the loop |
dc9dc135 XL |
9 | ... |
10 | LL | return result; | |
11 | | ------ returning this value requires that `list[_].value` is borrowed for `'1` | |
12 | ||
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 | |
15 | | | |
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` | |
18 | ... | |
19 | LL | if let Some(n) = list[0].next.as_mut() { | |
c295e0f8 | 20 | | ^^^^^^^^^^^^^^^^^^^^^ |
dc9dc135 | 21 | | | |
fc512014 | 22 | | `list[_].next` was mutably borrowed here in the previous iteration of the loop |
dc9dc135 XL |
23 | | argument requires that `list[_].next` is borrowed for `'1` |
24 | ||
25 | error: aborting due to 2 previous errors | |
26 | ||
27 | For more information about this error, try `rustc --explain E0499`. |