You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
enumEnum{A,B,C,}fnmain(){matchEnum::A{
x @ Enum::A | x @ Enum::B => match x {Enum::A => println!("a"),Enum::B => println!("b"),// _ => unreachable!(), // Won't compile without this line}Enum::C => println!("c"),}}
because the inner match only executes on A and B. But exhaustiveness is checked over the whole enum even though only a subset of variants are possible in this context.