2017-11-03 14:15:15 -05:00
|
|
|
#![crate_type = "rlib"]
|
|
|
|
|
|
|
|
#[non_exhaustive]
|
|
|
|
pub enum NonExhaustiveEnum {
|
|
|
|
Unit,
|
|
|
|
Tuple(u32),
|
2021-09-10 15:45:04 -05:00
|
|
|
Struct { field: u32 },
|
|
|
|
}
|
|
|
|
|
|
|
|
#[non_exhaustive]
|
|
|
|
pub enum NestedNonExhaustive {
|
|
|
|
A(NonExhaustiveEnum),
|
|
|
|
B,
|
|
|
|
C,
|
2017-11-03 14:15:15 -05:00
|
|
|
}
|
2019-11-30 09:51:26 -06:00
|
|
|
|
|
|
|
#[non_exhaustive]
|
|
|
|
pub enum EmptyNonExhaustiveEnum {}
|
2021-09-10 15:45:04 -05:00
|
|
|
|
|
|
|
pub enum VariantNonExhaustive {
|
|
|
|
#[non_exhaustive]
|
|
|
|
Bar {
|
|
|
|
x: u32,
|
|
|
|
y: u64,
|
|
|
|
},
|
|
|
|
Baz(u32, u16),
|
|
|
|
}
|
|
|
|
|
|
|
|
#[non_exhaustive]
|
|
|
|
pub enum NonExhaustiveSingleVariant {
|
|
|
|
A(bool),
|
|
|
|
}
|
2021-11-26 21:27:40 -06:00
|
|
|
|
|
|
|
#[repr(u8)]
|
|
|
|
pub enum FieldLessWithNonExhaustiveVariant {
|
|
|
|
A,
|
|
|
|
B,
|
|
|
|
#[non_exhaustive]
|
|
|
|
C,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Default for FieldLessWithNonExhaustiveVariant {
|
|
|
|
fn default() -> Self { Self::A }
|
|
|
|
}
|