The way to match on enums in MIR is in two steps: first read the discriminant, then switch on the resulting integer. This pass merges the two into a SwitchKind::Match that directly mentions enum variants.
SwitchKind::Match