Unexpected compile pass when pattern matching on union without unsafe
#110974
Labels
C-bug
Category: This is a bug.
unsafe
#110974
I tried this code:
I expected to see this happen: Compiler error, since pattern matching on a union is done without using
unsafe
; see the reference.Instead, this happened: Compile succeeds.
It seems that this only works when matching with a zero-sized union field, and it does not appear possible to actually extract the field's value by binding it to a name.
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: