Using unions currently causes panics, while mostly used for C FFI in Rust, there are couple of cases where they are used in Rust code, the main one being core::mem::MaybeUninit.
thread 'rustc' panicked at 'assertion failed: `(left != right)`
left: `0`,
right: `0`: TyAndLayout {
ty: Foo,
layout: Layout {
fields: Union(
1,
),
variants: Single {
index: 0,
},
abi: Aggregate {
sized: true,
},
largest_niche: None,
align: AbiAndPrefAlign {
abi: Align {
pow2: 0,
},
pref: Align {
pow2: 3,
},
},
size: Size {
raw: 0,
},
},
}', crates\rustc_codegen_spirv\src\abi.rs:638:13