rust/tests/ui/issues/issue-63983.rs
2023-01-11 09:32:08 +00:00

15 lines
365 B
Rust

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() {}