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

14 lines
333 B
Rust

enum Either<T, U> { Left(T), Right(U) }
struct S(Either<usize, usize>);
fn main() {
match S(Either::Left(5)) {
Either::Right(_) => {}
//~^ ERROR mismatched types
//~| expected struct `S`, found enum `Either`
//~| expected struct `S`
//~| found enum `Either<_, _>`
_ => {}
}
}