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(); }