]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc-2008-non-exhaustive/enum_same_crate.rs
parser will not give wrong help message for 'public'
[rust.git] / src / test / ui / rfc-2008-non-exhaustive / enum_same_crate.rs
1 // run-pass
2
3 #[non_exhaustive]
4 pub enum NonExhaustiveEnum {
5     Unit,
6     Tuple(u32),
7     Struct { field: u32 }
8 }
9
10 fn main() {
11     let enum_unit = NonExhaustiveEnum::Unit;
12
13     match enum_unit {
14         NonExhaustiveEnum::Unit => "first",
15         NonExhaustiveEnum::Tuple(_) => "second",
16         NonExhaustiveEnum::Struct { .. } => "third",
17     };
18 }