2 #![allow(const_err)] // make sure we cannot allow away the errors tested here
10 union MaybeUninit
<T
: Copy
> {
15 const BAD_BAD_BAD
: Bar
= unsafe { MaybeUninit { uninit: () }
.init
};
16 //~^ ERROR it is undefined behavior to use this value
18 const BAD_BAD_REF
: &Bar
= unsafe { mem::transmute(1usize) }
;
19 //~^ ERROR it is undefined behavior to use this value
21 const BAD_BAD_ARRAY
: [Bar
; 1] = unsafe { MaybeUninit { uninit: () }
.init
};
22 //~^ ERROR it is undefined behavior to use this value