]> git.lizzy.rs Git - rust.git/blob - src/test/ui/uninhabited/uninhabited-irrefutable.rs
Merge commit '7ea7cd165ad6705603852771bf82cc2fd6560db5' into clippyup2
[rust.git] / src / test / ui / uninhabited / uninhabited-irrefutable.rs
1 #![feature(never_type)]
2 #![feature(exhaustive_patterns)]
3
4 mod foo {
5     pub struct SecretlyEmpty {
6         _priv: !,
7     }
8
9     pub struct NotSoSecretlyEmpty {
10         pub _pub: !,
11     }
12 }
13
14 struct NotSoSecretlyEmpty {
15     _priv: !,
16 }
17
18 enum Foo {
19     A(foo::SecretlyEmpty),
20     B(foo::NotSoSecretlyEmpty),
21     C(NotSoSecretlyEmpty),
22     D(u32),
23 }
24
25 fn main() {
26     let x: Foo = Foo::D(123);
27     let Foo::D(_y) = x; //~ ERROR refutable pattern in local binding: `A(_)` not covered
28 }