1
1
error[E0381]: partially assigned binding `s` isn't fully initialized
2
- --> $DIR/structural_init.rs:104 :5
2
+ --> $DIR/structural_init.rs:102 :5
3
3
|
4
4
LL | let s: S<B>;
5
5
| - binding declared here but left uninitialized
@@ -9,7 +9,7 @@ LL | s.x = 10; s.y = Box::new(20);
9
9
= help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
10
10
11
11
error[E0381]: partially assigned binding `t` isn't fully initialized
12
- --> $DIR/structural_init.rs:110 :5
12
+ --> $DIR/structural_init.rs:108 :5
13
13
|
14
14
LL | let t: T;
15
15
| - binding declared here but left uninitialized
@@ -19,7 +19,7 @@ LL | t.0 = 10; t.1 = Box::new(20);
19
19
= help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
20
20
21
21
error[E0382]: assign to part of moved value: `s`
22
- --> $DIR/structural_init.rs:116 :5
22
+ --> $DIR/structural_init.rs:114 :5
23
23
|
24
24
LL | let mut s: S<B> = S::new(); drop(s);
25
25
| ----- - value moved here
@@ -29,7 +29,7 @@ LL | s.x = 10; s.y = Box::new(20);
29
29
| ^^^^^^^^ value partially assigned here after move
30
30
|
31
31
note: if `S<Box<u32>>` implemented `Clone`, you could clone the value
32
- --> $DIR/structural_init.rs:20 :1
32
+ --> $DIR/structural_init.rs:16 :1
33
33
|
34
34
LL | struct S<Y> {
35
35
| ^^^^^^^^^^^ consider implementing `Clone` for this type
@@ -38,7 +38,7 @@ LL | let mut s: S<B> = S::new(); drop(s);
38
38
| - you could clone this value
39
39
40
40
error[E0382]: assign to part of moved value: `t`
41
- --> $DIR/structural_init.rs:123 :5
41
+ --> $DIR/structural_init.rs:121 :5
42
42
|
43
43
LL | let mut t: T = (0, Box::new(0)); drop(t);
44
44
| ----- - value moved here
@@ -53,7 +53,7 @@ LL | let mut t: T = (0, Box::new(0)); drop(t.clone());
53
53
| ++++++++
54
54
55
55
error[E0381]: partially assigned binding `s` isn't fully initialized
56
- --> $DIR/structural_init.rs:130 :5
56
+ --> $DIR/structural_init.rs:128 :5
57
57
|
58
58
LL | let s: S<B>;
59
59
| - binding declared here but left uninitialized
@@ -63,7 +63,7 @@ LL | s.x = 10;
63
63
= help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
64
64
65
65
error[E0381]: partially assigned binding `t` isn't fully initialized
66
- --> $DIR/structural_init.rs:136 :5
66
+ --> $DIR/structural_init.rs:134 :5
67
67
|
68
68
LL | let t: T;
69
69
| - binding declared here but left uninitialized
@@ -73,7 +73,7 @@ LL | t.0 = 10;
73
73
= help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
74
74
75
75
error[E0382]: assign to part of moved value: `s`
76
- --> $DIR/structural_init.rs:142 :5
76
+ --> $DIR/structural_init.rs:140 :5
77
77
|
78
78
LL | let mut s: S<B> = S::new(); drop(s);
79
79
| ----- - value moved here
@@ -83,7 +83,7 @@ LL | s.x = 10;
83
83
| ^^^^^^^^ value partially assigned here after move
84
84
|
85
85
note: if `S<Box<u32>>` implemented `Clone`, you could clone the value
86
- --> $DIR/structural_init.rs:20 :1
86
+ --> $DIR/structural_init.rs:16 :1
87
87
|
88
88
LL | struct S<Y> {
89
89
| ^^^^^^^^^^^ consider implementing `Clone` for this type
@@ -92,7 +92,7 @@ LL | let mut s: S<B> = S::new(); drop(s);
92
92
| - you could clone this value
93
93
94
94
error[E0382]: assign to part of moved value: `t`
95
- --> $DIR/structural_init.rs:149 :5
95
+ --> $DIR/structural_init.rs:147 :5
96
96
|
97
97
LL | let mut t: T = (0, Box::new(0)); drop(t);
98
98
| ----- - value moved here
@@ -107,7 +107,7 @@ LL | let mut t: T = (0, Box::new(0)); drop(t.clone());
107
107
| ++++++++
108
108
109
109
error[E0381]: partially assigned binding `s` isn't fully initialized
110
- --> $DIR/structural_init.rs:156 :5
110
+ --> $DIR/structural_init.rs:154 :5
111
111
|
112
112
LL | let s: S<Void>;
113
113
| - binding declared here but left uninitialized
@@ -117,7 +117,7 @@ LL | s.x = 10;
117
117
= help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
118
118
119
119
error[E0381]: partially assigned binding `t` isn't fully initialized
120
- --> $DIR/structural_init.rs:162 :5
120
+ --> $DIR/structural_init.rs:160 :5
121
121
|
122
122
LL | let t: Tvoid;
123
123
| - binding declared here but left uninitialized
@@ -127,7 +127,7 @@ LL | t.0 = 10;
127
127
= help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
128
128
129
129
error[E0381]: partially assigned binding `q` isn't fully initialized
130
- --> $DIR/structural_init.rs:177 :5
130
+ --> $DIR/structural_init.rs:175 :5
131
131
|
132
132
LL | let q: Q<S<B>>;
133
133
| - binding declared here but left uninitialized
@@ -137,7 +137,7 @@ LL | q.r.f.x = 10; q.r.f.y = Box::new(20);
137
137
= help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
138
138
139
139
error[E0381]: partially assigned binding `q` isn't fully initialized
140
- --> $DIR/structural_init.rs:183 :5
140
+ --> $DIR/structural_init.rs:181 :5
141
141
|
142
142
LL | let q: Q<T>;
143
143
| - binding declared here but left uninitialized
@@ -147,7 +147,7 @@ LL | q.r.f.0 = 10; q.r.f.1 = Box::new(20);
147
147
= help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
148
148
149
149
error[E0382]: assign to part of moved value: `q.r`
150
- --> $DIR/structural_init.rs:189 :5
150
+ --> $DIR/structural_init.rs:187 :5
151
151
|
152
152
LL | let mut q: Q<S<B>> = Q::new(S::new()); drop(q.r);
153
153
| --- value moved here
@@ -157,7 +157,7 @@ LL | q.r.f.x = 10; q.r.f.y = Box::new(20);
157
157
= note: move occurs because `q.r` has type `R<S<Box<u32>>>`, which does not implement the `Copy` trait
158
158
159
159
error[E0382]: assign to part of moved value: `q.r`
160
- --> $DIR/structural_init.rs:196 :5
160
+ --> $DIR/structural_init.rs:194 :5
161
161
|
162
162
LL | let mut q: Q<T> = Q::new((0, Box::new(0))); drop(q.r);
163
163
| --- value moved here
@@ -167,7 +167,7 @@ LL | q.r.f.0 = 10; q.r.f.1 = Box::new(20);
167
167
= note: move occurs because `q.r` has type `R<(u32, Box<u32>)>`, which does not implement the `Copy` trait
168
168
169
169
error[E0381]: partially assigned binding `q` isn't fully initialized
170
- --> $DIR/structural_init.rs:203 :5
170
+ --> $DIR/structural_init.rs:201 :5
171
171
|
172
172
LL | let q: Q<S<B>>;
173
173
| - binding declared here but left uninitialized
@@ -177,7 +177,7 @@ LL | q.r.f.x = 10;
177
177
= help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
178
178
179
179
error[E0381]: partially assigned binding `q` isn't fully initialized
180
- --> $DIR/structural_init.rs:209 :5
180
+ --> $DIR/structural_init.rs:207 :5
181
181
|
182
182
LL | let q: Q<T>;
183
183
| - binding declared here but left uninitialized
@@ -187,7 +187,7 @@ LL | q.r.f.0 = 10;
187
187
= help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
188
188
189
189
error[E0382]: assign to part of moved value: `q.r`
190
- --> $DIR/structural_init.rs:215 :5
190
+ --> $DIR/structural_init.rs:213 :5
191
191
|
192
192
LL | let mut q: Q<S<B>> = Q::new(S::new()); drop(q.r);
193
193
| --- value moved here
@@ -197,7 +197,7 @@ LL | q.r.f.x = 10;
197
197
= note: move occurs because `q.r` has type `R<S<Box<u32>>>`, which does not implement the `Copy` trait
198
198
199
199
error[E0382]: assign to part of moved value: `q.r`
200
- --> $DIR/structural_init.rs:222 :5
200
+ --> $DIR/structural_init.rs:220 :5
201
201
|
202
202
LL | let mut q: Q<T> = Q::new((0, Box::new(0))); drop(q.r);
203
203
| --- value moved here
@@ -207,7 +207,7 @@ LL | q.r.f.0 = 10;
207
207
= note: move occurs because `q.r` has type `R<(u32, Box<u32>)>`, which does not implement the `Copy` trait
208
208
209
209
error[E0381]: partially assigned binding `q` isn't fully initialized
210
- --> $DIR/structural_init.rs:229 :5
210
+ --> $DIR/structural_init.rs:227 :5
211
211
|
212
212
LL | let q: Q<S<Void>>;
213
213
| - binding declared here but left uninitialized
@@ -217,7 +217,7 @@ LL | q.r.f.x = 10;
217
217
= help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
218
218
219
219
error[E0381]: partially assigned binding `q` isn't fully initialized
220
- --> $DIR/structural_init.rs:235 :5
220
+ --> $DIR/structural_init.rs:233 :5
221
221
|
222
222
LL | let q: Q<Tvoid>;
223
223
| - binding declared here but left uninitialized
@@ -227,7 +227,7 @@ LL | q.r.f.0 = 10;
227
227
= help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
228
228
229
229
error[E0382]: assign to part of moved value: `c`
230
- --> $DIR/structural_init.rs:252 :13
230
+ --> $DIR/structural_init.rs:250 :13
231
231
|
232
232
LL | let mut c = (1, "".to_owned());
233
233
| ----- move occurs because `c` has type `(i32, String)`, which does not implement the `Copy` trait
@@ -243,7 +243,7 @@ LL | ref c2 => {
243
243
| +++
244
244
245
245
error[E0382]: assign to part of moved value: `c`
246
- --> $DIR/structural_init.rs:262 :13
246
+ --> $DIR/structural_init.rs:260 :13
247
247
|
248
248
LL | let mut c = (1, (1, "".to_owned()));
249
249
| ----- move occurs because `c` has type `(i32, (i32, String))`, which does not implement the `Copy` trait
@@ -259,7 +259,7 @@ LL | ref c2 => {
259
259
| +++
260
260
261
261
error[E0382]: assign to part of moved value: `c.1`
262
- --> $DIR/structural_init.rs:270 :13
262
+ --> $DIR/structural_init.rs:268 :13
263
263
|
264
264
LL | c2 => {
265
265
| -- value moved here
@@ -272,7 +272,33 @@ help: borrow this binding in the pattern to avoid moving the value
272
272
LL | ref c2 => {
273
273
| +++
274
274
275
- error: aborting due to 23 previous errors
275
+ error[E0381]: used binding `e` isn't initialized
276
+ --> $DIR/structural_init.rs:278:10
277
+ |
278
+ LL | let e: Empty;
279
+ | - binding declared here but left uninitialized
280
+ LL | drop(e);
281
+ | ^ `e` used here but it isn't initialized
282
+ |
283
+ help: consider assigning a value
284
+ |
285
+ LL | let e: Empty = /* value */;
286
+ | +++++++++++++
287
+
288
+ error[E0381]: used binding `t` isn't initialized
289
+ --> $DIR/structural_init.rs:284:10
290
+ |
291
+ LL | let t: ();
292
+ | - binding declared here but left uninitialized
293
+ LL | drop(t);
294
+ | ^ `t` used here but it isn't initialized
295
+ |
296
+ help: consider assigning a value
297
+ |
298
+ LL | let t: () = ();
299
+ | ++++
300
+
301
+ error: aborting due to 25 previous errors
276
302
277
303
Some errors have detailed explanations: E0381, E0382.
278
304
For more information about an error, try `rustc --explain E0381`.
0 commit comments