1
1
error: the type `T` is generic, and might not permit being left uninitialized
2
- --> $DIR/mem-uninitialized-future-compat.rs:13 :5
2
+ --> $DIR/mem-uninitialized-future-compat.rs:26 :5
3
3
|
4
4
LL | std::mem::uninitialized::<T>();
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -16,7 +16,7 @@ LL | #![deny(mem_uninitialized)]
16
16
= note: type might not be allowed to be left uninitialized
17
17
18
18
error: the type `[T; N]` is generic, and might not permit being left uninitialized
19
- --> $DIR/mem-uninitialized-future-compat.rs:16 :5
19
+ --> $DIR/mem-uninitialized-future-compat.rs:29 :5
20
20
|
21
21
LL | std::mem::uninitialized::<[T; N]>();
22
22
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -28,7 +28,7 @@ LL | std::mem::uninitialized::<[T; N]>();
28
28
= note: type might not be allowed to be left uninitialized
29
29
30
30
error: the type `[char; N]` is generic, and might not permit being left uninitialized
31
- --> $DIR/mem-uninitialized-future-compat.rs:19 :5
31
+ --> $DIR/mem-uninitialized-future-compat.rs:32 :5
32
32
|
33
33
LL | std::mem::uninitialized::<[char; N]>();
34
34
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -40,7 +40,7 @@ LL | std::mem::uninitialized::<[char; N]>();
40
40
= note: characters must be a valid Unicode codepoint
41
41
42
42
error: the type `[UninitStruct; N]` is generic, and might not permit being left uninitialized
43
- --> $DIR/mem-uninitialized-future-compat.rs:22 :5
43
+ --> $DIR/mem-uninitialized-future-compat.rs:35 :5
44
44
|
45
45
LL | std::mem::uninitialized::<[UninitStruct; N]>();
46
46
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -55,8 +55,40 @@ note: characters must be a valid Unicode codepoint (in this struct field)
55
55
LL | b: char,
56
56
| ^^^^^^^
57
57
58
+ error: the type `std::result::Result<T, !>` does not permit being left uninitialized
59
+ --> $DIR/mem-uninitialized-future-compat.rs:38:5
60
+ |
61
+ LL | std::mem::uninitialized::<Result<T, !>>();
62
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
63
+ | |
64
+ | this code causes undefined behavior when executed
65
+ | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
66
+ |
67
+ = note: for more information, see FIXME: fill this in
68
+ note: enums have to be initialized to a variant
69
+ --> $SRC_DIR/core/src/result.rs:LL:COL
70
+ |
71
+ LL | pub enum Result<T, E> {
72
+ | ^^^^^^^^^^^^^^^^^^^^^
73
+
74
+ error: the type `OneVariantWith<T>` is generic, and might not permit being left uninitialized
75
+ --> $DIR/mem-uninitialized-future-compat.rs:41:5
76
+ |
77
+ LL | std::mem::uninitialized::<OneVariantWith<T>>();
78
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
79
+ | |
80
+ | this code causes undefined behavior when executed
81
+ | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
82
+ |
83
+ = note: for more information, see FIXME: fill this in
84
+ note: type might not be allowed to be left uninitialized (in this enum field)
85
+ --> $DIR/mem-uninitialized-future-compat.rs:22:11
86
+ |
87
+ LL | Hello(T),
88
+ | ^
89
+
58
90
error: the type `&u32` does not permit being left uninitialized
59
- --> $DIR/mem-uninitialized-future-compat.rs:31 :9
91
+ --> $DIR/mem-uninitialized-future-compat.rs:50 :9
60
92
|
61
93
LL | std::mem::uninitialized::<&'static u32>();
62
94
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -68,7 +100,7 @@ LL | std::mem::uninitialized::<&'static u32>();
68
100
= note: references must be non-null
69
101
70
102
error: the type `std::boxed::Box<u32>` does not permit being left uninitialized
71
- --> $DIR/mem-uninitialized-future-compat.rs:34 :9
103
+ --> $DIR/mem-uninitialized-future-compat.rs:53 :9
72
104
|
73
105
LL | std::mem::uninitialized::<Box<u32>>();
74
106
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -80,7 +112,7 @@ LL | std::mem::uninitialized::<Box<u32>>();
80
112
= note: `Box` must be non-null
81
113
82
114
error: the type `fn()` does not permit being left uninitialized
83
- --> $DIR/mem-uninitialized-future-compat.rs:37 :9
115
+ --> $DIR/mem-uninitialized-future-compat.rs:56 :9
84
116
|
85
117
LL | std::mem::uninitialized::<fn()>();
86
118
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -92,7 +124,7 @@ LL | std::mem::uninitialized::<fn()>();
92
124
= note: function pointers must be non-null
93
125
94
126
error: the type `!` does not permit being left uninitialized
95
- --> $DIR/mem-uninitialized-future-compat.rs:40 :9
127
+ --> $DIR/mem-uninitialized-future-compat.rs:59 :9
96
128
|
97
129
LL | std::mem::uninitialized::<!>();
98
130
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -104,7 +136,7 @@ LL | std::mem::uninitialized::<!>();
104
136
= note: the `!` type has no valid value
105
137
106
138
error: the type `*mut dyn std::io::Write` does not permit being left uninitialized
107
- --> $DIR/mem-uninitialized-future-compat.rs:43 :9
139
+ --> $DIR/mem-uninitialized-future-compat.rs:62 :9
108
140
|
109
141
LL | std::mem::uninitialized::<*mut dyn std::io::Write>();
110
142
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -116,7 +148,7 @@ LL | std::mem::uninitialized::<*mut dyn std::io::Write>();
116
148
= note: the vtable of a wide raw pointer must be non-null
117
149
118
150
error: the type `bool` does not permit being left uninitialized
119
- --> $DIR/mem-uninitialized-future-compat.rs:46 :9
151
+ --> $DIR/mem-uninitialized-future-compat.rs:65 :9
120
152
|
121
153
LL | std::mem::uninitialized::<bool>();
122
154
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -128,7 +160,7 @@ LL | std::mem::uninitialized::<bool>();
128
160
= note: booleans must be either `true` or `false`
129
161
130
162
error: the type `char` does not permit being left uninitialized
131
- --> $DIR/mem-uninitialized-future-compat.rs:49 :9
163
+ --> $DIR/mem-uninitialized-future-compat.rs:68 :9
132
164
|
133
165
LL | std::mem::uninitialized::<char>();
134
166
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -140,7 +172,7 @@ LL | std::mem::uninitialized::<char>();
140
172
= note: characters must be a valid Unicode codepoint
141
173
142
174
error: the type `UninitStruct` does not permit being left uninitialized
143
- --> $DIR/mem-uninitialized-future-compat.rs:52 :9
175
+ --> $DIR/mem-uninitialized-future-compat.rs:71 :9
144
176
|
145
177
LL | std::mem::uninitialized::<UninitStruct>();
146
178
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -156,7 +188,7 @@ LL | b: char,
156
188
| ^^^^^^^
157
189
158
190
error: the type `[UninitStruct; 16]` does not permit being left uninitialized
159
- --> $DIR/mem-uninitialized-future-compat.rs:55 :9
191
+ --> $DIR/mem-uninitialized-future-compat.rs:74 :9
160
192
|
161
193
LL | std::mem::uninitialized::<[UninitStruct; 16]>();
162
194
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -172,7 +204,7 @@ LL | b: char,
172
204
| ^^^^^^^
173
205
174
206
error: the type `(u32, char)` does not permit being left uninitialized
175
- --> $DIR/mem-uninitialized-future-compat.rs:58 :9
207
+ --> $DIR/mem-uninitialized-future-compat.rs:77 :9
176
208
|
177
209
LL | std::mem::uninitialized::<(u32, char)>();
178
210
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -183,11 +215,107 @@ LL | std::mem::uninitialized::<(u32, char)>();
183
215
= note: for more information, see FIXME: fill this in
184
216
= note: characters must be a valid Unicode codepoint
185
217
186
- error: aborting due to 14 previous errors
218
+ error: the type `TwoVariant` does not permit being left uninitialized
219
+ --> $DIR/mem-uninitialized-future-compat.rs:80:9
220
+ |
221
+ LL | std::mem::uninitialized::<TwoVariant>();
222
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
223
+ | |
224
+ | this code causes undefined behavior when executed
225
+ | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
226
+ |
227
+ = note: for more information, see FIXME: fill this in
228
+ note: enums have to be initialized to a variant
229
+ --> $DIR/mem-uninitialized-future-compat.rs:16:1
230
+ |
231
+ LL | enum TwoVariant {
232
+ | ^^^^^^^^^^^^^^^
233
+
234
+ error: the type `std::result::Result<!, !>` does not permit being left uninitialized
235
+ --> $DIR/mem-uninitialized-future-compat.rs:83:9
236
+ |
237
+ LL | std::mem::uninitialized::<Result<!, !>>();
238
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
239
+ | |
240
+ | this code causes undefined behavior when executed
241
+ | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
242
+ |
243
+ = note: for more information, see FIXME: fill this in
244
+ note: enums have to be initialized to a variant
245
+ --> $SRC_DIR/core/src/result.rs:LL:COL
246
+ |
247
+ LL | pub enum Result<T, E> {
248
+ | ^^^^^^^^^^^^^^^^^^^^^
249
+
250
+ error: the type `std::result::Result<!, u32>` does not permit being left uninitialized
251
+ --> $DIR/mem-uninitialized-future-compat.rs:86:9
252
+ |
253
+ LL | std::mem::uninitialized::<Result<!, u32>>();
254
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
255
+ | |
256
+ | this code causes undefined behavior when executed
257
+ | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
258
+ |
259
+ = note: for more information, see FIXME: fill this in
260
+ note: enums have to be initialized to a variant
261
+ --> $SRC_DIR/core/src/result.rs:LL:COL
262
+ |
263
+ LL | pub enum Result<T, E> {
264
+ | ^^^^^^^^^^^^^^^^^^^^^
265
+
266
+ error: the type `std::option::Option<!>` does not permit being left uninitialized
267
+ --> $DIR/mem-uninitialized-future-compat.rs:89:9
268
+ |
269
+ LL | std::mem::uninitialized::<Option<!>>();
270
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
271
+ | |
272
+ | this code causes undefined behavior when executed
273
+ | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
274
+ |
275
+ = note: for more information, see FIXME: fill this in
276
+ note: enums have to be initialized to a variant
277
+ --> $SRC_DIR/core/src/option.rs:LL:COL
278
+ |
279
+ LL | pub enum Option<T> {
280
+ | ^^^^^^^^^^^^^^^^^^
281
+
282
+ error: the type `OneVariantWith<char>` does not permit being left uninitialized
283
+ --> $DIR/mem-uninitialized-future-compat.rs:92:9
284
+ |
285
+ LL | std::mem::uninitialized::<OneVariantWith<char>>();
286
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
287
+ | |
288
+ | this code causes undefined behavior when executed
289
+ | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
290
+ |
291
+ = note: for more information, see FIXME: fill this in
292
+ note: characters must be a valid Unicode codepoint (in this enum field)
293
+ --> $DIR/mem-uninitialized-future-compat.rs:22:11
294
+ |
295
+ LL | Hello(T),
296
+ | ^
297
+
298
+ error: the type `OneVariantWith<!>` does not permit being left uninitialized
299
+ --> $DIR/mem-uninitialized-future-compat.rs:95:9
300
+ |
301
+ LL | std::mem::uninitialized::<OneVariantWith<!>>();
302
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
303
+ | |
304
+ | this code causes undefined behavior when executed
305
+ | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
306
+ |
307
+ = note: for more information, see FIXME: fill this in
308
+ note: the `!` type has no valid value (in this enum field)
309
+ --> $DIR/mem-uninitialized-future-compat.rs:22:11
310
+ |
311
+ LL | Hello(T),
312
+ | ^
313
+
314
+ error: aborting due to 22 previous errors
187
315
188
316
Future incompatibility report: Future breakage diagnostic:
189
317
error: the type `T` is generic, and might not permit being left uninitialized
190
- --> $DIR/mem-uninitialized-future-compat.rs:13 :5
318
+ --> $DIR/mem-uninitialized-future-compat.rs:26 :5
191
319
|
192
320
LL | std::mem::uninitialized::<T>();
193
321
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -205,7 +333,7 @@ LL | #![deny(mem_uninitialized)]
205
333
206
334
Future breakage diagnostic:
207
335
error: the type `[T; N]` is generic, and might not permit being left uninitialized
208
- --> $DIR/mem-uninitialized-future-compat.rs:16 :5
336
+ --> $DIR/mem-uninitialized-future-compat.rs:29 :5
209
337
|
210
338
LL | std::mem::uninitialized::<[T; N]>();
211
339
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -223,7 +351,7 @@ LL | #![deny(mem_uninitialized)]
223
351
224
352
Future breakage diagnostic:
225
353
error: the type `[char; N]` is generic, and might not permit being left uninitialized
226
- --> $DIR/mem-uninitialized-future-compat.rs:19 :5
354
+ --> $DIR/mem-uninitialized-future-compat.rs:32 :5
227
355
|
228
356
LL | std::mem::uninitialized::<[char; N]>();
229
357
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -241,7 +369,7 @@ LL | #![deny(mem_uninitialized)]
241
369
242
370
Future breakage diagnostic:
243
371
error: the type `[UninitStruct; N]` is generic, and might not permit being left uninitialized
244
- --> $DIR/mem-uninitialized-future-compat.rs:22 :5
372
+ --> $DIR/mem-uninitialized-future-compat.rs:35 :5
245
373
|
246
374
LL | std::mem::uninitialized::<[UninitStruct; N]>();
247
375
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -261,9 +389,53 @@ note: characters must be a valid Unicode codepoint (in this struct field)
261
389
LL | b: char,
262
390
| ^^^^^^^
263
391
392
+ Future breakage diagnostic:
393
+ error: the type `std::result::Result<T, !>` does not permit being left uninitialized
394
+ --> $DIR/mem-uninitialized-future-compat.rs:38:5
395
+ |
396
+ LL | std::mem::uninitialized::<Result<T, !>>();
397
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
398
+ | |
399
+ | this code causes undefined behavior when executed
400
+ | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
401
+ |
402
+ note: the lint level is defined here
403
+ --> $DIR/mem-uninitialized-future-compat.rs:2:9
404
+ |
405
+ LL | #![deny(mem_uninitialized)]
406
+ | ^^^^^^^^^^^^^^^^^
407
+ = note: for more information, see FIXME: fill this in
408
+ note: enums have to be initialized to a variant
409
+ --> $SRC_DIR/core/src/result.rs:LL:COL
410
+ |
411
+ LL | pub enum Result<T, E> {
412
+ | ^^^^^^^^^^^^^^^^^^^^^
413
+
414
+ Future breakage diagnostic:
415
+ error: the type `OneVariantWith<T>` is generic, and might not permit being left uninitialized
416
+ --> $DIR/mem-uninitialized-future-compat.rs:41:5
417
+ |
418
+ LL | std::mem::uninitialized::<OneVariantWith<T>>();
419
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
420
+ | |
421
+ | this code causes undefined behavior when executed
422
+ | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
423
+ |
424
+ note: the lint level is defined here
425
+ --> $DIR/mem-uninitialized-future-compat.rs:2:9
426
+ |
427
+ LL | #![deny(mem_uninitialized)]
428
+ | ^^^^^^^^^^^^^^^^^
429
+ = note: for more information, see FIXME: fill this in
430
+ note: type might not be allowed to be left uninitialized (in this enum field)
431
+ --> $DIR/mem-uninitialized-future-compat.rs:22:11
432
+ |
433
+ LL | Hello(T),
434
+ | ^
435
+
264
436
Future breakage diagnostic:
265
437
error: the type `&u32` does not permit being left uninitialized
266
- --> $DIR/mem-uninitialized-future-compat.rs:31 :9
438
+ --> $DIR/mem-uninitialized-future-compat.rs:50 :9
267
439
|
268
440
LL | std::mem::uninitialized::<&'static u32>();
269
441
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -281,7 +453,7 @@ LL | #![deny(mem_uninitialized)]
281
453
282
454
Future breakage diagnostic:
283
455
error: the type `std::boxed::Box<u32>` does not permit being left uninitialized
284
- --> $DIR/mem-uninitialized-future-compat.rs:34 :9
456
+ --> $DIR/mem-uninitialized-future-compat.rs:53 :9
285
457
|
286
458
LL | std::mem::uninitialized::<Box<u32>>();
287
459
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -299,7 +471,7 @@ LL | #![deny(mem_uninitialized)]
299
471
300
472
Future breakage diagnostic:
301
473
error: the type `fn()` does not permit being left uninitialized
302
- --> $DIR/mem-uninitialized-future-compat.rs:37 :9
474
+ --> $DIR/mem-uninitialized-future-compat.rs:56 :9
303
475
|
304
476
LL | std::mem::uninitialized::<fn()>();
305
477
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -317,7 +489,7 @@ LL | #![deny(mem_uninitialized)]
317
489
318
490
Future breakage diagnostic:
319
491
error: the type `!` does not permit being left uninitialized
320
- --> $DIR/mem-uninitialized-future-compat.rs:40 :9
492
+ --> $DIR/mem-uninitialized-future-compat.rs:59 :9
321
493
|
322
494
LL | std::mem::uninitialized::<!>();
323
495
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -335,7 +507,7 @@ LL | #![deny(mem_uninitialized)]
335
507
336
508
Future breakage diagnostic:
337
509
error: the type `*mut dyn std::io::Write` does not permit being left uninitialized
338
- --> $DIR/mem-uninitialized-future-compat.rs:43 :9
510
+ --> $DIR/mem-uninitialized-future-compat.rs:62 :9
339
511
|
340
512
LL | std::mem::uninitialized::<*mut dyn std::io::Write>();
341
513
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -353,7 +525,7 @@ LL | #![deny(mem_uninitialized)]
353
525
354
526
Future breakage diagnostic:
355
527
error: the type `bool` does not permit being left uninitialized
356
- --> $DIR/mem-uninitialized-future-compat.rs:46 :9
528
+ --> $DIR/mem-uninitialized-future-compat.rs:65 :9
357
529
|
358
530
LL | std::mem::uninitialized::<bool>();
359
531
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -371,7 +543,7 @@ LL | #![deny(mem_uninitialized)]
371
543
372
544
Future breakage diagnostic:
373
545
error: the type `char` does not permit being left uninitialized
374
- --> $DIR/mem-uninitialized-future-compat.rs:49 :9
546
+ --> $DIR/mem-uninitialized-future-compat.rs:68 :9
375
547
|
376
548
LL | std::mem::uninitialized::<char>();
377
549
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -389,7 +561,7 @@ LL | #![deny(mem_uninitialized)]
389
561
390
562
Future breakage diagnostic:
391
563
error: the type `UninitStruct` does not permit being left uninitialized
392
- --> $DIR/mem-uninitialized-future-compat.rs:52 :9
564
+ --> $DIR/mem-uninitialized-future-compat.rs:71 :9
393
565
|
394
566
LL | std::mem::uninitialized::<UninitStruct>();
395
567
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -411,7 +583,7 @@ LL | b: char,
411
583
412
584
Future breakage diagnostic:
413
585
error: the type `[UninitStruct; 16]` does not permit being left uninitialized
414
- --> $DIR/mem-uninitialized-future-compat.rs:55 :9
586
+ --> $DIR/mem-uninitialized-future-compat.rs:74 :9
415
587
|
416
588
LL | std::mem::uninitialized::<[UninitStruct; 16]>();
417
589
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -433,7 +605,7 @@ LL | b: char,
433
605
434
606
Future breakage diagnostic:
435
607
error: the type `(u32, char)` does not permit being left uninitialized
436
- --> $DIR/mem-uninitialized-future-compat.rs:58 :9
608
+ --> $DIR/mem-uninitialized-future-compat.rs:77 :9
437
609
|
438
610
LL | std::mem::uninitialized::<(u32, char)>();
439
611
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -449,3 +621,135 @@ LL | #![deny(mem_uninitialized)]
449
621
= note: for more information, see FIXME: fill this in
450
622
= note: characters must be a valid Unicode codepoint
451
623
624
+ Future breakage diagnostic:
625
+ error: the type `TwoVariant` does not permit being left uninitialized
626
+ --> $DIR/mem-uninitialized-future-compat.rs:80:9
627
+ |
628
+ LL | std::mem::uninitialized::<TwoVariant>();
629
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
630
+ | |
631
+ | this code causes undefined behavior when executed
632
+ | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
633
+ |
634
+ note: the lint level is defined here
635
+ --> $DIR/mem-uninitialized-future-compat.rs:2:9
636
+ |
637
+ LL | #![deny(mem_uninitialized)]
638
+ | ^^^^^^^^^^^^^^^^^
639
+ = note: for more information, see FIXME: fill this in
640
+ note: enums have to be initialized to a variant
641
+ --> $DIR/mem-uninitialized-future-compat.rs:16:1
642
+ |
643
+ LL | enum TwoVariant {
644
+ | ^^^^^^^^^^^^^^^
645
+
646
+ Future breakage diagnostic:
647
+ error: the type `std::result::Result<!, !>` does not permit being left uninitialized
648
+ --> $DIR/mem-uninitialized-future-compat.rs:83:9
649
+ |
650
+ LL | std::mem::uninitialized::<Result<!, !>>();
651
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
652
+ | |
653
+ | this code causes undefined behavior when executed
654
+ | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
655
+ |
656
+ note: the lint level is defined here
657
+ --> $DIR/mem-uninitialized-future-compat.rs:2:9
658
+ |
659
+ LL | #![deny(mem_uninitialized)]
660
+ | ^^^^^^^^^^^^^^^^^
661
+ = note: for more information, see FIXME: fill this in
662
+ note: enums have to be initialized to a variant
663
+ --> $SRC_DIR/core/src/result.rs:LL:COL
664
+ |
665
+ LL | pub enum Result<T, E> {
666
+ | ^^^^^^^^^^^^^^^^^^^^^
667
+
668
+ Future breakage diagnostic:
669
+ error: the type `std::result::Result<!, u32>` does not permit being left uninitialized
670
+ --> $DIR/mem-uninitialized-future-compat.rs:86:9
671
+ |
672
+ LL | std::mem::uninitialized::<Result<!, u32>>();
673
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
674
+ | |
675
+ | this code causes undefined behavior when executed
676
+ | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
677
+ |
678
+ note: the lint level is defined here
679
+ --> $DIR/mem-uninitialized-future-compat.rs:2:9
680
+ |
681
+ LL | #![deny(mem_uninitialized)]
682
+ | ^^^^^^^^^^^^^^^^^
683
+ = note: for more information, see FIXME: fill this in
684
+ note: enums have to be initialized to a variant
685
+ --> $SRC_DIR/core/src/result.rs:LL:COL
686
+ |
687
+ LL | pub enum Result<T, E> {
688
+ | ^^^^^^^^^^^^^^^^^^^^^
689
+
690
+ Future breakage diagnostic:
691
+ error: the type `std::option::Option<!>` does not permit being left uninitialized
692
+ --> $DIR/mem-uninitialized-future-compat.rs:89:9
693
+ |
694
+ LL | std::mem::uninitialized::<Option<!>>();
695
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
696
+ | |
697
+ | this code causes undefined behavior when executed
698
+ | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
699
+ |
700
+ note: the lint level is defined here
701
+ --> $DIR/mem-uninitialized-future-compat.rs:2:9
702
+ |
703
+ LL | #![deny(mem_uninitialized)]
704
+ | ^^^^^^^^^^^^^^^^^
705
+ = note: for more information, see FIXME: fill this in
706
+ note: enums have to be initialized to a variant
707
+ --> $SRC_DIR/core/src/option.rs:LL:COL
708
+ |
709
+ LL | pub enum Option<T> {
710
+ | ^^^^^^^^^^^^^^^^^^
711
+
712
+ Future breakage diagnostic:
713
+ error: the type `OneVariantWith<char>` does not permit being left uninitialized
714
+ --> $DIR/mem-uninitialized-future-compat.rs:92:9
715
+ |
716
+ LL | std::mem::uninitialized::<OneVariantWith<char>>();
717
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
718
+ | |
719
+ | this code causes undefined behavior when executed
720
+ | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
721
+ |
722
+ note: the lint level is defined here
723
+ --> $DIR/mem-uninitialized-future-compat.rs:2:9
724
+ |
725
+ LL | #![deny(mem_uninitialized)]
726
+ | ^^^^^^^^^^^^^^^^^
727
+ = note: for more information, see FIXME: fill this in
728
+ note: characters must be a valid Unicode codepoint (in this enum field)
729
+ --> $DIR/mem-uninitialized-future-compat.rs:22:11
730
+ |
731
+ LL | Hello(T),
732
+ | ^
733
+
734
+ Future breakage diagnostic:
735
+ error: the type `OneVariantWith<!>` does not permit being left uninitialized
736
+ --> $DIR/mem-uninitialized-future-compat.rs:95:9
737
+ |
738
+ LL | std::mem::uninitialized::<OneVariantWith<!>>();
739
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
740
+ | |
741
+ | this code causes undefined behavior when executed
742
+ | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
743
+ |
744
+ note: the lint level is defined here
745
+ --> $DIR/mem-uninitialized-future-compat.rs:2:9
746
+ |
747
+ LL | #![deny(mem_uninitialized)]
748
+ | ^^^^^^^^^^^^^^^^^
749
+ = note: for more information, see FIXME: fill this in
750
+ note: the `!` type has no valid value (in this enum field)
751
+ --> $DIR/mem-uninitialized-future-compat.rs:22:11
752
+ |
753
+ LL | Hello(T),
754
+ | ^
755
+
0 commit comments