|
| 1 | +error[E0499]: cannot borrow `list.0.value` as mutable more than once at a time |
| 2 | + --> $DIR/assignment-to-differing-field.rs:23:21 |
| 3 | + | |
| 4 | +LL | fn assignment_to_field_projection<'a, T>( |
| 5 | + | -- lifetime `'a` defined here |
| 6 | +... |
| 7 | +LL | result.push(&mut (list.0).value); |
| 8 | + | ^^^^^^^^^^^^^^^^^^^ `list.0.value` was mutably borrowed here in the previous iteration of the loop |
| 9 | +... |
| 10 | +LL | return result; |
| 11 | + | ------ returning this value requires that `list.0.value` is borrowed for `'a` |
| 12 | + |
| 13 | +error[E0499]: cannot borrow `list.0.next` as mutable more than once at a time |
| 14 | + --> $DIR/assignment-to-differing-field.rs:26:26 |
| 15 | + | |
| 16 | +LL | fn assignment_to_field_projection<'a, T>( |
| 17 | + | -- lifetime `'a` defined here |
| 18 | +... |
| 19 | +LL | if let Some(n) = (list.0).next.as_mut() { |
| 20 | + | ^^^^^^^^^^^^^ `list.0.next` was mutably borrowed here in the previous iteration of the loop |
| 21 | +LL | |
| 22 | +LL | list.1 = n; |
| 23 | + | ---------- assignment requires that `list.0.next` is borrowed for `'a` |
| 24 | + |
| 25 | +error[E0499]: cannot borrow `list.0.0.0.0.0.value` as mutable more than once at a time |
| 26 | + --> $DIR/assignment-to-differing-field.rs:40:21 |
| 27 | + | |
| 28 | +LL | fn assignment_through_projection_chain<'a, T>( |
| 29 | + | -- lifetime `'a` defined here |
| 30 | +... |
| 31 | +LL | result.push(&mut ((((list.0).0).0).0).0.value); |
| 32 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `list.0.0.0.0.0.value` was mutably borrowed here in the previous iteration of the loop |
| 33 | +... |
| 34 | +LL | return result; |
| 35 | + | ------ returning this value requires that `list.0.0.0.0.0.value` is borrowed for `'a` |
| 36 | + |
| 37 | +error[E0499]: cannot borrow `list.0.0.0.0.0.next` as mutable more than once at a time |
| 38 | + --> $DIR/assignment-to-differing-field.rs:43:26 |
| 39 | + | |
| 40 | +LL | fn assignment_through_projection_chain<'a, T>( |
| 41 | + | -- lifetime `'a` defined here |
| 42 | +... |
| 43 | +LL | if let Some(n) = ((((list.0).0).0).0).0.next.as_mut() { |
| 44 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `list.0.0.0.0.0.next` was mutably borrowed here in the previous iteration of the loop |
| 45 | +LL | |
| 46 | +LL | *((((list.0).0).0).0).1 = n; |
| 47 | + | --------------------------- assignment requires that `list.0.0.0.0.0.next` is borrowed for `'a` |
| 48 | + |
| 49 | +error: aborting due to 4 previous errors |
| 50 | + |
| 51 | +For more information about this error, try `rustc --explain E0499`. |
0 commit comments