fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1error[E0499]: cannot borrow `list.0.value` as mutable more than once at a time 2 --> $DIR/issue-62007-assign-differing-fields.rs:16:21 3 | 4LL | fn to_refs<'a, T>(mut list: (&'a mut List<T>, &'a mut List<T>)) -> Vec<&'a mut T> { 5 | -- lifetime `'a` defined here 6... 7LL | result.push(&mut (list.0).value); 8 | ^^^^^^^^^^^^^^^^^^^ `list.0.value` was mutably borrowed here in the previous iteration of the loop 9... 10LL | return result; 11 | ------ returning this value requires that `list.0.value` is borrowed for `'a` 12 13error[E0499]: cannot borrow `list.0.next` as mutable more than once at a time 14 --> $DIR/issue-62007-assign-differing-fields.rs:17:26 15 | 16LL | fn to_refs<'a, T>(mut list: (&'a mut List<T>, &'a mut List<T>)) -> Vec<&'a mut T> { 17 | -- lifetime `'a` defined here 18... 19LL | if let Some(n) = (list.0).next.as_mut() { 20 | ^^^^^^^^^^^^^--------- 21 | | 22 | `list.0.next` was mutably borrowed here in the previous iteration of the loop 23 | argument requires that `list.0.next` is borrowed for `'a` 24 25error: aborting due to 2 previous errors 26 27For more information about this error, try `rustc --explain E0499`.