fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #69444 - pietroalbini:stable-next-final-v2-new, r=pietroalbinif3e1a954d2e

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