From 64d98f8ee037282c35007b64c2649055c56af1db Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:03 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/consts/const-enum-tuple.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/ui/consts/const-enum-tuple.rs (limited to 'tests/ui/consts/const-enum-tuple.rs') diff --git a/tests/ui/consts/const-enum-tuple.rs b/tests/ui/consts/const-enum-tuple.rs new file mode 100644 index 000000000..e0363166b --- /dev/null +++ b/tests/ui/consts/const-enum-tuple.rs @@ -0,0 +1,11 @@ +// run-pass +#![allow(dead_code)] + +enum E { V16(u16), V32(u32) } +static C: (E, u16, u16) = (E::V16(0xDEAD), 0x600D, 0xBAD); + +pub fn main() { + let (_, n, _) = C; + assert!(n != 0xBAD); + assert_eq!(n, 0x600D); +} -- cgit v1.2.3