From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- .../ui/rfc-2008-non-exhaustive/auxiliary/enums.rs | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 tests/ui/rfc-2008-non-exhaustive/auxiliary/enums.rs (limited to 'tests/ui/rfc-2008-non-exhaustive/auxiliary/enums.rs') diff --git a/tests/ui/rfc-2008-non-exhaustive/auxiliary/enums.rs b/tests/ui/rfc-2008-non-exhaustive/auxiliary/enums.rs new file mode 100644 index 000000000..cb2b585ab --- /dev/null +++ b/tests/ui/rfc-2008-non-exhaustive/auxiliary/enums.rs @@ -0,0 +1,44 @@ +#![crate_type = "rlib"] + +#[non_exhaustive] +pub enum NonExhaustiveEnum { + Unit, + Tuple(u32), + Struct { field: u32 }, +} + +#[non_exhaustive] +pub enum NestedNonExhaustive { + A(NonExhaustiveEnum), + B, + C, +} + +#[non_exhaustive] +pub enum EmptyNonExhaustiveEnum {} + +pub enum VariantNonExhaustive { + #[non_exhaustive] + Bar { + x: u32, + y: u64, + }, + Baz(u32, u16), +} + +#[non_exhaustive] +pub enum NonExhaustiveSingleVariant { + A(bool), +} + +#[repr(u8)] +pub enum FieldLessWithNonExhaustiveVariant { + A, + B, + #[non_exhaustive] + C, +} + +impl Default for FieldLessWithNonExhaustiveVariant { + fn default() -> Self { Self::A } +} -- cgit v1.2.3