@@ -97,7 +97,7 @@ LL | let _val: (i32, !) = mem::uninitialized();
9797 | this code causes undefined behavior when executed
9898 | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
9999 |
100- = note: the `!` type has no valid value
100+ = note: integers must not be uninitialized
101101
102102error: the type `Void` does not permit zero-initialization
103103 --> $DIR/uninitialized-zeroed.rs:57:26
@@ -414,8 +414,19 @@ LL | let _val: [bool; 2] = mem::uninitialized();
414414 |
415415 = note: booleans must be either `true` or `false`
416416
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+
417428error: the type `&i32` does not permit zero-initialization
418- --> $DIR/uninitialized-zeroed.rs:104 :34
429+ --> $DIR/uninitialized-zeroed.rs:107 :34
419430 |
420431LL | let _val: &'static i32 = mem::transmute(0usize);
421432 | ^^^^^^^^^^^^^^^^^^^^^^
@@ -426,7 +437,7 @@ LL | let _val: &'static i32 = mem::transmute(0usize);
426437 = note: references must be non-null
427438
428439error: the type `&[i32]` does not permit zero-initialization
429- --> $DIR/uninitialized-zeroed.rs:105 :36
440+ --> $DIR/uninitialized-zeroed.rs:108 :36
430441 |
431442LL | let _val: &'static [i32] = mem::transmute((0usize, 0usize));
432443 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -437,7 +448,7 @@ LL | let _val: &'static [i32] = mem::transmute((0usize, 0usize));
437448 = note: references must be non-null
438449
439450error: the type `NonZeroU32` does not permit zero-initialization
440- --> $DIR/uninitialized-zeroed.rs:106 :32
451+ --> $DIR/uninitialized-zeroed.rs:109 :32
441452 |
442453LL | let _val: NonZeroU32 = mem::transmute(0);
443454 | ^^^^^^^^^^^^^^^^^
@@ -448,7 +459,7 @@ LL | let _val: NonZeroU32 = mem::transmute(0);
448459 = note: `std::num::NonZeroU32` must be non-null
449460
450461error: the type `NonNull<i32>` does not permit zero-initialization
451- --> $DIR/uninitialized-zeroed.rs:109 :34
462+ --> $DIR/uninitialized-zeroed.rs:112 :34
452463 |
453464LL | let _val: NonNull<i32> = MaybeUninit::zeroed().assume_init();
454465 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -459,7 +470,7 @@ LL | let _val: NonNull<i32> = MaybeUninit::zeroed().assume_init();
459470 = note: `std::ptr::NonNull<i32>` must be non-null
460471
461472error: the type `NonNull<i32>` does not permit being left uninitialized
462- --> $DIR/uninitialized-zeroed.rs:110 :34
473+ --> $DIR/uninitialized-zeroed.rs:113 :34
463474 |
464475LL | let _val: NonNull<i32> = MaybeUninit::uninit().assume_init();
465476 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -470,7 +481,7 @@ LL | let _val: NonNull<i32> = MaybeUninit::uninit().assume_init();
470481 = note: `std::ptr::NonNull<i32>` must be non-null
471482
472483error: the type `bool` does not permit being left uninitialized
473- --> $DIR/uninitialized-zeroed.rs:111 :26
484+ --> $DIR/uninitialized-zeroed.rs:114 :26
474485 |
475486LL | let _val: bool = MaybeUninit::uninit().assume_init();
476487 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -480,5 +491,5 @@ LL | let _val: bool = MaybeUninit::uninit().assume_init();
480491 |
481492 = note: booleans must be either `true` or `false`
482493
483- error: aborting due to 39 previous errors
494+ error: aborting due to 40 previous errors
484495
0 commit comments