2019-09-21 10:36:12 -05:00
|
|
|
enum MyEnum {
|
|
|
|
Tuple(i32),
|
|
|
|
Struct{ s: i32 },
|
|
|
|
}
|
|
|
|
|
|
|
|
fn foo(en: MyEnum) {
|
|
|
|
match en {
|
|
|
|
MyEnum::Tuple => "",
|
2019-10-14 19:20:50 -05:00
|
|
|
//~^ ERROR expected unit struct, unit variant or constant, found tuple variant `MyEnum::Tuple`
|
2019-09-21 10:36:12 -05:00
|
|
|
MyEnum::Struct => "",
|
2019-10-14 19:20:50 -05:00
|
|
|
//~^ ERROR expected unit struct, unit variant or constant, found struct variant `MyEnum::Struct`
|
2019-09-21 10:36:12 -05:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|