]> git.lizzy.rs Git - rust.git/blob - tests/ui/never_type/exhaustive_patterns.rs
Rollup merge of #107615 - notriddle:notriddle/nbsp, r=GuillaumeGomez
[rust.git] / tests / ui / never_type / exhaustive_patterns.rs
1 // check-fail
2 // known-bug: #104034
3
4 #![feature(exhaustive_patterns, never_type)]
5
6 mod inner {
7     pub struct Wrapper<T>(T);
8 }
9
10 enum Either<A, B> {
11     A(A),
12     B(inner::Wrapper<B>),
13 }
14
15 fn foo() -> Either<(), !> {
16     Either::A(())
17 }
18
19 fn main() {
20     let Either::A(()) = foo();
21 }