2021-09-18 15:52:43 -05:00
|
|
|
// aux-build:hidden.rs
|
|
|
|
|
|
|
|
extern crate hidden;
|
|
|
|
|
2021-10-27 19:57:47 -05:00
|
|
|
use hidden::HiddenEnum;
|
2021-09-18 15:52:43 -05:00
|
|
|
|
2021-12-06 15:17:22 -06:00
|
|
|
enum InCrate {
|
|
|
|
A,
|
|
|
|
B,
|
|
|
|
#[doc(hidden)]
|
|
|
|
C,
|
|
|
|
}
|
|
|
|
|
2021-09-18 15:52:43 -05:00
|
|
|
fn main() {
|
2021-10-27 19:57:47 -05:00
|
|
|
match HiddenEnum::A {
|
|
|
|
HiddenEnum::A => {}
|
|
|
|
HiddenEnum::B => {}
|
2021-09-18 15:52:43 -05:00
|
|
|
}
|
|
|
|
//~^^^^ non-exhaustive patterns: `_` not covered
|
|
|
|
|
2021-10-27 19:57:47 -05:00
|
|
|
match HiddenEnum::A {
|
|
|
|
HiddenEnum::A => {}
|
|
|
|
HiddenEnum::C => {}
|
2021-09-18 15:52:43 -05:00
|
|
|
}
|
2022-09-02 22:01:35 -05:00
|
|
|
//~^^^^ non-exhaustive patterns: `HiddenEnum::B` not covered
|
2021-09-18 15:52:43 -05:00
|
|
|
|
2021-10-27 19:57:47 -05:00
|
|
|
match HiddenEnum::A {
|
|
|
|
HiddenEnum::A => {}
|
2021-09-18 15:52:43 -05:00
|
|
|
}
|
2022-09-02 22:01:35 -05:00
|
|
|
//~^^^ non-exhaustive patterns: `HiddenEnum::B` and `_` not covered
|
2021-09-18 15:52:43 -05:00
|
|
|
|
|
|
|
match None {
|
|
|
|
None => {}
|
2021-10-27 19:57:47 -05:00
|
|
|
Some(HiddenEnum::A) => {}
|
2021-09-18 15:52:43 -05:00
|
|
|
}
|
2022-09-02 22:01:35 -05:00
|
|
|
//~^^^^ non-exhaustive patterns: `Some(HiddenEnum::B)` and `Some(_)` not covered
|
2021-12-06 15:17:22 -06:00
|
|
|
|
|
|
|
match InCrate::A {
|
|
|
|
InCrate::A => {}
|
|
|
|
InCrate::B => {}
|
|
|
|
}
|
2022-09-02 22:01:35 -05:00
|
|
|
//~^^^^ non-exhaustive patterns: `InCrate::C` not covered
|
2021-09-18 15:52:43 -05:00
|
|
|
}
|