Matching on uninhabited unsafe places (union fields, raw pointer dereferences, etc.) allowed in safe code. · Issue #47412 · rust-lang/rust (original) (raw)
fn main() { #[derive(Copy, Clone)] enum Void {} union A { a: (), v: Void } let a = A { a: () }; match a.v { } }
it is possible to invoke undefined behaviour in safe code without using unstable features.