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
When the enum variants listed in a match block omit the preceding EnumName:: the compiler may still accept the code, even if some cases were not handled or nonexistent variants are listed.
I tried this code:
enumEnum{A,B,C,}fnmain(){let b = Enum::B;match b {A => println!("A"),B => println!("B"),Foo => {},}}
I expected to see this happen: Compiler errors regarding missing Enum::, missing variant Enum::C, and invalid variant.
Instead, this happened: the code compiled and printed "A"