Closed
Description
Running it in miri gives the following error:
error: Undefined Behavior: enum value has invalid tag: 0x07
--> example/union.rs:49:15
|
49 | match foo {
| ^^^ enum value has invalid tag: 0x07
|
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
= note: inside `main` at example/union.rs:49:15
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
I found this issue because cg_clif aborts matching on an invalid discriminant.
cc @Smittyvb as you introduced this test.