rust/src/test/ui/issues/issue-5358-1.rs
2018-12-25 21:08:33 -07:00

14 lines
331 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 type `S`
//~| found type `Either<_, _>`
//~| expected struct `S`, found enum `Either`
_ => {}
}
}