1 #![allow(const_err)] // make sure we cannot allow away the errors tested here
3 //! Test the "array of int" fast path in validity checking, and in particular whether it
4 //! points at the right array element.
9 union MaybeUninit<T: Copy> {
14 const UNINIT_INT_0: [u32; 3] = unsafe {
15 //~^ ERROR it is undefined behavior to use this value
16 //~| type validation failed: encountered uninitialized bytes at [0]
18 MaybeUninit { uninit: () }.init,
23 const UNINIT_INT_1: [u32; 3] = unsafe {
24 //~^ ERROR it is undefined behavior to use this value
25 //~| type validation failed: encountered uninitialized bytes at [1]
33 MaybeUninit { uninit: () }.init,
38 MaybeUninit { uninit: () }.init,
43 const UNINIT_INT_2: [u32; 3] = unsafe {
44 //~^ ERROR it is undefined behavior to use this value
45 //~| type validation failed: encountered uninitialized bytes at [2]
59 MaybeUninit { uninit: () }.init,