]> git.lizzy.rs Git - rust.git/blob - src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.rs
Merge commit '3c7e7dbc1583a0b06df5bd7623dd354a4debd23d' into clippyup
[rust.git] / src / test / ui / pattern / usefulness / doc-hidden-non-exhaustive.rs
1 // aux-build:hidden.rs
2
3 extern crate hidden;
4
5 use hidden::HiddenEnum;
6
7 enum InCrate {
8     A,
9     B,
10     #[doc(hidden)]
11     C,
12 }
13
14 fn main() {
15     match HiddenEnum::A {
16         HiddenEnum::A => {}
17         HiddenEnum::B => {}
18     }
19     //~^^^^ non-exhaustive patterns: `_` not covered
20
21     match HiddenEnum::A {
22         HiddenEnum::A => {}
23         HiddenEnum::C => {}
24     }
25     //~^^^^ non-exhaustive patterns: `B` not covered
26
27     match HiddenEnum::A {
28         HiddenEnum::A => {}
29     }
30     //~^^^ non-exhaustive patterns: `B` and `_` not covered
31
32     match None {
33         None => {}
34         Some(HiddenEnum::A) => {}
35     }
36     //~^^^^ non-exhaustive patterns: `Some(B)` and `Some(_)` not covered
37
38     match InCrate::A {
39         InCrate::A => {}
40         InCrate::B => {}
41     }
42     //~^^^^ non-exhaustive patterns: `C` not covered
43 }