1 #![feature(box_patterns)]
2 #![feature(never_type)]
3 #![feature(exhaustive_patterns)]
6 #![deny(unreachable_patterns)]
9 pub struct SecretlyEmpty {
14 struct NotSoSecretlyEmpty {
18 fn foo() -> Option<NotSoSecretlyEmpty> {
27 &[..] => (), //~ ERROR unreachable pattern
30 let x: Result<Box<NotSoSecretlyEmpty>, &[Result<!, !>]> = Err(&[]);
32 Ok(box _) => (), //~ ERROR unreachable pattern
34 Err(&[..]) => (), //~ ERROR unreachable pattern
37 let x: Result<foo::SecretlyEmpty, Result<NotSoSecretlyEmpty, u32>> = Err(Err(123));
41 Err(Ok(_y)) => (), //~ ERROR unreachable pattern
44 while let Some(_y) = foo() {
45 //~^ ERROR unreachable pattern