@@ -97,7 +97,7 @@ LL | let _val: (i32, !) = mem::uninitialized();
97
97
| this code causes undefined behavior when executed
98
98
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
99
99
|
100
- = note: the `!` type has no valid value
100
+ = note: integers must not be uninitialized
101
101
102
102
error: the type `Void` does not permit zero-initialization
103
103
--> $DIR/uninitialized-zeroed.rs:57:26
@@ -414,8 +414,19 @@ LL | let _val: [bool; 2] = mem::uninitialized();
414
414
|
415
415
= note: booleans must be either `true` or `false`
416
416
417
+ error: the type `i32` does not permit being left uninitialized
418
+ --> $DIR/uninitialized-zeroed.rs:104:25
419
+ |
420
+ LL | let _val: i32 = mem::uninitialized();
421
+ | ^^^^^^^^^^^^^^^^^^^^
422
+ | |
423
+ | this code causes undefined behavior when executed
424
+ | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
425
+ |
426
+ = note: integers must not be uninitialized
427
+
417
428
error: the type `&i32` does not permit zero-initialization
418
- --> $DIR/uninitialized-zeroed.rs:104 :34
429
+ --> $DIR/uninitialized-zeroed.rs:107 :34
419
430
|
420
431
LL | let _val: &'static i32 = mem::transmute(0usize);
421
432
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -426,7 +437,7 @@ LL | let _val: &'static i32 = mem::transmute(0usize);
426
437
= note: references must be non-null
427
438
428
439
error: the type `&[i32]` does not permit zero-initialization
429
- --> $DIR/uninitialized-zeroed.rs:105 :36
440
+ --> $DIR/uninitialized-zeroed.rs:108 :36
430
441
|
431
442
LL | let _val: &'static [i32] = mem::transmute((0usize, 0usize));
432
443
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -437,7 +448,7 @@ LL | let _val: &'static [i32] = mem::transmute((0usize, 0usize));
437
448
= note: references must be non-null
438
449
439
450
error: the type `NonZeroU32` does not permit zero-initialization
440
- --> $DIR/uninitialized-zeroed.rs:106 :32
451
+ --> $DIR/uninitialized-zeroed.rs:109 :32
441
452
|
442
453
LL | let _val: NonZeroU32 = mem::transmute(0);
443
454
| ^^^^^^^^^^^^^^^^^
@@ -448,7 +459,7 @@ LL | let _val: NonZeroU32 = mem::transmute(0);
448
459
= note: `std::num::NonZeroU32` must be non-null
449
460
450
461
error: the type `NonNull<i32>` does not permit zero-initialization
451
- --> $DIR/uninitialized-zeroed.rs:109 :34
462
+ --> $DIR/uninitialized-zeroed.rs:112 :34
452
463
|
453
464
LL | let _val: NonNull<i32> = MaybeUninit::zeroed().assume_init();
454
465
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -459,7 +470,7 @@ LL | let _val: NonNull<i32> = MaybeUninit::zeroed().assume_init();
459
470
= note: `std::ptr::NonNull<i32>` must be non-null
460
471
461
472
error: the type `NonNull<i32>` does not permit being left uninitialized
462
- --> $DIR/uninitialized-zeroed.rs:110 :34
473
+ --> $DIR/uninitialized-zeroed.rs:113 :34
463
474
|
464
475
LL | let _val: NonNull<i32> = MaybeUninit::uninit().assume_init();
465
476
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -470,7 +481,7 @@ LL | let _val: NonNull<i32> = MaybeUninit::uninit().assume_init();
470
481
= note: `std::ptr::NonNull<i32>` must be non-null
471
482
472
483
error: the type `bool` does not permit being left uninitialized
473
- --> $DIR/uninitialized-zeroed.rs:111 :26
484
+ --> $DIR/uninitialized-zeroed.rs:114 :26
474
485
|
475
486
LL | let _val: bool = MaybeUninit::uninit().assume_init();
476
487
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -480,5 +491,5 @@ LL | let _val: bool = MaybeUninit::uninit().assume_init();
480
491
|
481
492
= note: booleans must be either `true` or `false`
482
493
483
- error: aborting due to 39 previous errors
494
+ error: aborting due to 40 previous errors
484
495
0 commit comments