Unions with ZSTs are no longer usable #59126
Labels
A-const-eval
Area: Constant evaluation, covers all const contexts (static, const fn, ...)
C-bug
Category: This is a bug.
P-high
High priority
regression-from-stable-to-stable
Performance or correctness regression from one stable version to another.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
It looks like this was broken in the release of 1.32.0 (and is still broken, even on nightly) (checked on https://rust.godbolt.org/). The following example program:
Fails to compile:
Interestingly, making the
union
#[repr(C)]
fixes it.My Rust version:
I know
union
field accesses aren't stable, but I don't think this qualifies as a field access. And yes, I'm aware ofMaybeUninit
.cc @RalfJung
The text was updated successfully, but these errors were encountered: