about summary refs log tree commit diff
path: root/tests/ui/match/mismatched-types-in-match-5358.rs
blob: d096bf3a493d656729af9c0fca8312c526e84360 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// https://github.com/rust-lang/rust/issues/5358
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<_, _>`
        _ => {}
    }
}