mirror of
https://github.com/rust-lang/rust.git
synced 2026-01-19 22:20:36 +00:00
14 lines
380 B
Rust
14 lines
380 B
Rust
enum Either<T, U> { Left(T), Right(U) }
|
|
struct S(Either<usize, usize>);
|
|
|
|
fn main() {
|
|
match S(Either::Left(5)) { //~ NOTE this expression has type `S`
|
|
Either::Right(_) => {}
|
|
//~^ ERROR mismatched types
|
|
//~| NOTE expected `S`, found `Either<_, _>`
|
|
//~| NOTE expected struct `S`
|
|
//~| NOTE found enum `Either<_, _>`
|
|
_ => {}
|
|
}
|
|
}
|