summaryrefslogtreecommitdiffstats
path: root/tests/ui/never_type/exhaustive_patterns.rs
blob: 2e23fa1828091b38b2264cab404d59140042ff7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// check-fail
// known-bug: #104034

#![feature(exhaustive_patterns, never_type)]

mod inner {
    pub struct Wrapper<T>(T);
}

enum Either<A, B> {
    A(A),
    B(inner::Wrapper<B>),
}

fn foo() -> Either<(), !> {
    Either::A(())
}

fn main() {
    let Either::A(()) = foo();
}