Nested match on enum values panics in the SSA builder. This blocks writing manual impl Eq for enums.
use core::ops::Eq
pub enum Color { Red, Green, Blue }
impl Eq for Color {
fn eq(self, _ other: Color) -> bool {
match self {
Color::Red => match other {
Color::Red => true,
_ => false,
},
Color::Green => match other {
Color::Green => true,
_ => false,
},
Color::Blue => match other {
Color::Blue => true,
_ => false,
},
}
}
}
panicked at crates/ir/src/builder/ssa.rs:139
variable is undefined or used in unreachable block
Nested match on enum values panics in the SSA builder. This blocks writing manual
impl Eqfor enums.