blob: ab952666fd1dae1aeb8d7d281c6e64c71b8c90dd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
enum MyEnum {
Tuple(i32),
Struct{ s: i32 },
}
fn foo(en: MyEnum) {
match en {
MyEnum::Tuple => "",
//~^ ERROR expected unit struct, unit variant or constant, found tuple variant `MyEnum::Tuple`
MyEnum::Struct => "",
//~^ ERROR expected unit struct, unit variant or constant, found struct variant `MyEnum::Struct`
};
}
fn main() {}
|