summaryrefslogtreecommitdiffstats
path: root/tests/ui/nll/issue-21232-partial-init-and-use.stderr
blob: 97ed414b1eceb8ced620331d99e3d08b24314486 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
error[E0381]: partially assigned binding `s` isn't fully initialized
  --> $DIR/issue-21232-partial-init-and-use.rs:97:5
   |
LL |     let s: S<B>;
   |         - binding declared here but left uninitialized
LL |     s.x = 10; s.y = Box::new(20);
   |     ^^^^^^^^ `s` partially assigned here but it isn't fully initialized
   |
   = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`

error[E0381]: partially assigned binding `t` isn't fully initialized
  --> $DIR/issue-21232-partial-init-and-use.rs:103:5
   |
LL |     let t: T;
   |         - binding declared here but left uninitialized
LL |     t.0 = 10; t.1 = Box::new(20);
   |     ^^^^^^^^ `t` partially assigned here but it isn't fully initialized
   |
   = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`

error[E0382]: assign to part of moved value: `s`
  --> $DIR/issue-21232-partial-init-and-use.rs:109:5
   |
LL |     let mut s: S<B> = S::new(); drop(s);
   |         -----                        - value moved here
   |         |
   |         move occurs because `s` has type `S<Box<u32>>`, which does not implement the `Copy` trait
LL |     s.x = 10; s.y = Box::new(20);
   |     ^^^^^^^^ value partially assigned here after move

error[E0382]: assign to part of moved value: `t`
  --> $DIR/issue-21232-partial-init-and-use.rs:116:5
   |
LL |     let mut t: T = (0, Box::new(0)); drop(t);
   |         -----                             - value moved here
   |         |
   |         move occurs because `t` has type `(u32, Box<u32>)`, which does not implement the `Copy` trait
LL |     t.0 = 10; t.1 = Box::new(20);
   |     ^^^^^^^^ value partially assigned here after move
   |
help: consider cloning the value if the performance cost is acceptable
   |
LL |     let mut t: T = (0, Box::new(0)); drop(t.clone());
   |                                            ++++++++

error[E0381]: partially assigned binding `s` isn't fully initialized
  --> $DIR/issue-21232-partial-init-and-use.rs:123:5
   |
LL |     let s: S<B>;
   |         - binding declared here but left uninitialized
LL |     s.x = 10;
   |     ^^^^^^^^ `s` partially assigned here but it isn't fully initialized
   |
   = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`

error[E0381]: partially assigned binding `t` isn't fully initialized
  --> $DIR/issue-21232-partial-init-and-use.rs:129:5
   |
LL |     let t: T;
   |         - binding declared here but left uninitialized
LL |     t.0 = 10;
   |     ^^^^^^^^ `t` partially assigned here but it isn't fully initialized
   |
   = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`

error[E0382]: assign to part of moved value: `s`
  --> $DIR/issue-21232-partial-init-and-use.rs:135:5
   |
LL |     let mut s: S<B> = S::new(); drop(s);
   |         -----                        - value moved here
   |         |
   |         move occurs because `s` has type `S<Box<u32>>`, which does not implement the `Copy` trait
LL |     s.x = 10;
   |     ^^^^^^^^ value partially assigned here after move

error[E0382]: assign to part of moved value: `t`
  --> $DIR/issue-21232-partial-init-and-use.rs:142:5
   |
LL |     let mut t: T = (0, Box::new(0)); drop(t);
   |         -----                             - value moved here
   |         |
   |         move occurs because `t` has type `(u32, Box<u32>)`, which does not implement the `Copy` trait
LL |     t.0 = 10;
   |     ^^^^^^^^ value partially assigned here after move
   |
help: consider cloning the value if the performance cost is acceptable
   |
LL |     let mut t: T = (0, Box::new(0)); drop(t.clone());
   |                                            ++++++++

error[E0381]: partially assigned binding `s` isn't fully initialized
  --> $DIR/issue-21232-partial-init-and-use.rs:149:5
   |
LL |     let s: S<Void>;
   |         - binding declared here but left uninitialized
LL |     s.x = 10;
   |     ^^^^^^^^ `s` partially assigned here but it isn't fully initialized
   |
   = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`

error[E0381]: partially assigned binding `t` isn't fully initialized
  --> $DIR/issue-21232-partial-init-and-use.rs:155:5
   |
LL |     let t: Tvoid;
   |         - binding declared here but left uninitialized
LL |     t.0 = 10;
   |     ^^^^^^^^ `t` partially assigned here but it isn't fully initialized
   |
   = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`

error[E0381]: partially assigned binding `q` isn't fully initialized
  --> $DIR/issue-21232-partial-init-and-use.rs:170:5
   |
LL |     let q: Q<S<B>>;
   |         - binding declared here but left uninitialized
LL |     q.r.f.x = 10; q.r.f.y = Box::new(20);
   |     ^^^^^^^^^^^^ `q.r.f` partially assigned here but it isn't fully initialized
   |
   = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`

error[E0381]: partially assigned binding `q` isn't fully initialized
  --> $DIR/issue-21232-partial-init-and-use.rs:176:5
   |
LL |     let q: Q<T>;
   |         - binding declared here but left uninitialized
LL |     q.r.f.0 = 10; q.r.f.1 = Box::new(20);
   |     ^^^^^^^^^^^^ `q.r.f` partially assigned here but it isn't fully initialized
   |
   = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`

error[E0382]: assign to part of moved value: `q.r`
  --> $DIR/issue-21232-partial-init-and-use.rs:182:5
   |
LL |     let mut q: Q<S<B>> = Q::new(S::new()); drop(q.r);
   |                                                 --- value moved here
LL |     q.r.f.x = 10; q.r.f.y = Box::new(20);
   |     ^^^^^^^^^^^^ value partially assigned here after move
   |
   = note: move occurs because `q.r` has type `R<S<Box<u32>>>`, which does not implement the `Copy` trait

error[E0382]: assign to part of moved value: `q.r`
  --> $DIR/issue-21232-partial-init-and-use.rs:189:5
   |
LL |     let mut q: Q<T> = Q::new((0, Box::new(0))); drop(q.r);
   |                                                      --- value moved here
LL |     q.r.f.0 = 10; q.r.f.1 = Box::new(20);
   |     ^^^^^^^^^^^^ value partially assigned here after move
   |
   = note: move occurs because `q.r` has type `R<(u32, Box<u32>)>`, which does not implement the `Copy` trait

error[E0381]: partially assigned binding `q` isn't fully initialized
  --> $DIR/issue-21232-partial-init-and-use.rs:196:5
   |
LL |     let q: Q<S<B>>;
   |         - binding declared here but left uninitialized
LL |     q.r.f.x = 10;
   |     ^^^^^^^^^^^^ `q.r.f` partially assigned here but it isn't fully initialized
   |
   = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`

error[E0381]: partially assigned binding `q` isn't fully initialized
  --> $DIR/issue-21232-partial-init-and-use.rs:202:5
   |
LL |     let q: Q<T>;
   |         - binding declared here but left uninitialized
LL |     q.r.f.0 = 10;
   |     ^^^^^^^^^^^^ `q.r.f` partially assigned here but it isn't fully initialized
   |
   = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`

error[E0382]: assign to part of moved value: `q.r`
  --> $DIR/issue-21232-partial-init-and-use.rs:208:5
   |
LL |     let mut q: Q<S<B>> = Q::new(S::new()); drop(q.r);
   |                                                 --- value moved here
LL |     q.r.f.x = 10;
   |     ^^^^^^^^^^^^ value partially assigned here after move
   |
   = note: move occurs because `q.r` has type `R<S<Box<u32>>>`, which does not implement the `Copy` trait

error[E0382]: assign to part of moved value: `q.r`
  --> $DIR/issue-21232-partial-init-and-use.rs:215:5
   |
LL |     let mut q: Q<T> = Q::new((0, Box::new(0))); drop(q.r);
   |                                                      --- value moved here
LL |     q.r.f.0 = 10;
   |     ^^^^^^^^^^^^ value partially assigned here after move
   |
   = note: move occurs because `q.r` has type `R<(u32, Box<u32>)>`, which does not implement the `Copy` trait

error[E0381]: partially assigned binding `q` isn't fully initialized
  --> $DIR/issue-21232-partial-init-and-use.rs:222:5
   |
LL |     let mut q: Q<S<Void>>;
   |         ----- binding declared here but left uninitialized
LL |     q.r.f.x = 10;
   |     ^^^^^^^^^^^^ `q.r.f` partially assigned here but it isn't fully initialized
   |
   = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`

error[E0381]: partially assigned binding `q` isn't fully initialized
  --> $DIR/issue-21232-partial-init-and-use.rs:228:5
   |
LL |     let mut q: Q<Tvoid>;
   |         ----- binding declared here but left uninitialized
LL |     q.r.f.0 = 10;
   |     ^^^^^^^^^^^^ `q.r.f` partially assigned here but it isn't fully initialized
   |
   = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`

error[E0382]: assign to part of moved value: `c`
  --> $DIR/issue-21232-partial-init-and-use.rs:245:13
   |
LL |     let mut c = (1, "".to_owned());
   |         ----- move occurs because `c` has type `(i32, String)`, which does not implement the `Copy` trait
LL |     match c {
LL |         c2 => {
   |         -- value moved here
LL |             c.0 = 2;
   |             ^^^^^^^ value partially assigned here after move
   |
help: borrow this binding in the pattern to avoid moving the value
   |
LL |         ref c2 => {
   |         +++

error[E0382]: assign to part of moved value: `c`
  --> $DIR/issue-21232-partial-init-and-use.rs:255:13
   |
LL |     let mut c = (1, (1, "".to_owned()));
   |         ----- move occurs because `c` has type `(i32, (i32, String))`, which does not implement the `Copy` trait
LL |     match c {
LL |         c2 => {
   |         -- value moved here
LL |             (c.1).0 = 2;
   |             ^^^^^^^^^^^ value partially assigned here after move
   |
help: borrow this binding in the pattern to avoid moving the value
   |
LL |         ref c2 => {
   |         +++

error[E0382]: assign to part of moved value: `c.1`
  --> $DIR/issue-21232-partial-init-and-use.rs:263:13
   |
LL |         c2 => {
   |         -- value moved here
LL |             ((c.1).1).0 = 3;
   |             ^^^^^^^^^^^^^^^ value partially assigned here after move
   |
   = note: move occurs because `c.1` has type `(i32, (i32, String))`, which does not implement the `Copy` trait
help: borrow this binding in the pattern to avoid moving the value
   |
LL |         ref c2 => {
   |         +++

error: aborting due to 23 previous errors

Some errors have detailed explanations: E0381, E0382.
For more information about an error, try `rustc --explain E0381`.