1 error[E0505]: cannot move out of `arr[..]` because it is borrowed
2 --> $DIR/borrowck-move-ref-pattern.rs:8:24
4 LL | let hold_all = &arr;
5 | ---- borrow of `arr` occurs here
6 LL | let [ref _x0_hold, _x1, ref xs_hold @ ..] = arr;
7 | ^^^ move out of `arr[..]` occurs here
10 | -------- borrow later used here
12 error[E0384]: cannot assign twice to immutable variable `_x1`
13 --> $DIR/borrowck-move-ref-pattern.rs:9:5
15 LL | let [ref _x0_hold, _x1, ref xs_hold @ ..] = arr;
18 | first assignment to `_x1`
19 | help: consider making this binding mutable: `mut _x1`
21 | ^^^^^^^ cannot assign twice to immutable variable
23 error[E0505]: cannot move out of `arr[..]` because it is borrowed
24 --> $DIR/borrowck-move-ref-pattern.rs:11:10
26 LL | let [ref _x0_hold, _x1, ref xs_hold @ ..] = arr;
27 | ------------ borrow of `arr[..]` occurs here
29 LL | let [_x0, ..] = arr;
30 | ^^^ move out of `arr[..]` occurs here
32 | -------- borrow later used here
34 error[E0502]: cannot borrow `arr[..]` as mutable because it is also borrowed as immutable
35 --> $DIR/borrowck-move-ref-pattern.rs:13:16
37 LL | let [ref _x0_hold, _x1, ref xs_hold @ ..] = arr;
38 | ----------- immutable borrow occurs here
40 LL | let [_, _, ref mut _x2, _x3, mut _x4] = arr;
41 | ^^^^^^^^^^^ mutable borrow occurs here
44 | ------- immutable borrow later used here
46 error[E0505]: cannot move out of `arr[..]` because it is borrowed
47 --> $DIR/borrowck-move-ref-pattern.rs:13:29
49 LL | let [ref _x0_hold, _x1, ref xs_hold @ ..] = arr;
50 | ----------- borrow of `arr[..]` occurs here
52 LL | let [_, _, ref mut _x2, _x3, mut _x4] = arr;
53 | ^^^ move out of `arr[..]` occurs here
56 | ------- borrow later used here
58 error[E0505]: cannot move out of `arr[..]` because it is borrowed
59 --> $DIR/borrowck-move-ref-pattern.rs:13:34
61 LL | let [ref _x0_hold, _x1, ref xs_hold @ ..] = arr;
62 | ----------- borrow of `arr[..]` occurs here
64 LL | let [_, _, ref mut _x2, _x3, mut _x4] = arr;
65 | ^^^^^^^ move out of `arr[..]` occurs here
68 | ------- borrow later used here
70 error[E0384]: cannot assign twice to immutable variable `_x1`
71 --> $DIR/borrowck-move-ref-pattern.rs:23:5
73 LL | let (ref _x0, _x1, ref _x2, ..) = tup;
76 | first assignment to `_x1`
77 | help: consider making this binding mutable: `mut _x1`
79 | ^^^^^^^ cannot assign twice to immutable variable
81 error[E0502]: cannot borrow `tup.0` as mutable because it is also borrowed as immutable
82 --> $DIR/borrowck-move-ref-pattern.rs:24:20
84 LL | let (ref _x0, _x1, ref _x2, ..) = tup;
85 | ------- immutable borrow occurs here
87 LL | let _x0_hold = &mut tup.0;
88 | ^^^^^^^^^^ mutable borrow occurs here
89 LL | let (ref mut _x0_hold, ..) = tup;
91 | -------- immutable borrow later used here
93 error[E0502]: cannot borrow `tup.0` as mutable because it is also borrowed as immutable
94 --> $DIR/borrowck-move-ref-pattern.rs:25:10
96 LL | let (ref _x0, _x1, ref _x2, ..) = tup;
97 | ------- immutable borrow occurs here
99 LL | let (ref mut _x0_hold, ..) = tup;
100 | ^^^^^^^^^^^^^^^^ mutable borrow occurs here
102 | -------- immutable borrow later used here
104 error[E0594]: cannot assign to `*_x0`, which is behind a `&` reference
105 --> $DIR/borrowck-move-ref-pattern.rs:26:5
107 LL | let (ref _x0, _x1, ref _x2, ..) = tup;
108 | ------- help: consider changing this to be a mutable reference: `ref mut _x0`
111 | ^^^^^^^^ `_x0` is a `&` reference, so the data it refers to cannot be written
113 error[E0594]: cannot assign to `*_x2`, which is behind a `&` reference
114 --> $DIR/borrowck-move-ref-pattern.rs:27:5
116 LL | let (ref _x0, _x1, ref _x2, ..) = tup;
117 | ------- help: consider changing this to be a mutable reference: `ref mut _x2`
120 | ^^^^^^^^ `_x2` is a `&` reference, so the data it refers to cannot be written
122 error[E0382]: use of moved value: `tup.1`
123 --> $DIR/borrowck-move-ref-pattern.rs:28:10
125 LL | let (ref _x0, _x1, ref _x2, ..) = tup;
126 | --- value moved here
129 | ^^^^^ value used here after move
131 = note: move occurs because `tup.1` has type `U`, which does not implement the `Copy` trait
132 help: borrow this binding in the pattern to avoid moving the value
134 LL | let (ref _x0, ref _x1, ref _x2, ..) = tup;
137 error[E0382]: borrow of moved value: `tup.1`
138 --> $DIR/borrowck-move-ref-pattern.rs:29:20
141 | ----- value moved here
142 LL | let _x1_hold = &tup.1;
143 | ^^^^^^ value borrowed here after move
145 = note: move occurs because `tup.1` has type `U`, which does not implement the `Copy` trait
147 error[E0502]: cannot borrow `tup.3` as immutable because it is also borrowed as mutable
148 --> $DIR/borrowck-move-ref-pattern.rs:31:20
150 LL | let (.., ref mut _x3) = tup;
151 | ----------- mutable borrow occurs here
152 LL | let _x3_hold = &tup.3;
153 | ^^^^^^ immutable borrow occurs here
156 | --- mutable borrow later used here
158 error[E0499]: cannot borrow `tup.3` as mutable more than once at a time
159 --> $DIR/borrowck-move-ref-pattern.rs:32:20
161 LL | let (.., ref mut _x3) = tup;
162 | ----------- first mutable borrow occurs here
163 LL | let _x3_hold = &tup.3;
164 LL | let _x3_hold = &mut tup.3;
165 | ^^^^^^^^^^ second mutable borrow occurs here
168 | --- first borrow later used here
170 error[E0499]: cannot borrow `tup.3` as mutable more than once at a time
171 --> $DIR/borrowck-move-ref-pattern.rs:33:14
173 LL | let (.., ref mut _x3) = tup;
174 | ----------- first mutable borrow occurs here
176 LL | let (.., ref mut _x4_hold) = tup;
177 | ^^^^^^^^^^^^^^^^ second mutable borrow occurs here
178 LL | let (.., ref _x4_hold) = tup;
180 | --- first borrow later used here
182 error[E0502]: cannot borrow `tup.3` as immutable because it is also borrowed as mutable
183 --> $DIR/borrowck-move-ref-pattern.rs:34:14
185 LL | let (.., ref mut _x3) = tup;
186 | ----------- mutable borrow occurs here
188 LL | let (.., ref _x4_hold) = tup;
189 | ^^^^^^^^^^^^ immutable borrow occurs here
191 | --- mutable borrow later used here
193 error[E0382]: use of moved value: `tup`
194 --> $DIR/borrowck-move-ref-pattern.rs:43:14
196 LL | let mut tup = (U, U, U);
197 | ------- move occurs because `tup` has type `(U, U, U)`, which does not implement the `Copy` trait
199 | -- value moved into closure here
200 LL | let (ref _x0, _x1, _) = tup;
201 | --- variable moved due to use in closure
204 | ^^ value used here after move
206 LL | let (ref mut _x0, _, _x2) = tup;
207 | --- use occurs due to use in closure
209 error: aborting due to 18 previous errors
211 Some errors have detailed explanations: E0382, E0384, E0499, E0502, E0505, E0594.
212 For more information about an error, try `rustc --explain E0382`.