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-vector.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/ui/consts/const-enum-vector.rs (limited to 'tests/ui/consts/const-enum-vector.rs') diff --git a/tests/ui/consts/const-enum-vector.rs b/tests/ui/consts/const-enum-vector.rs new file mode 100644 index 000000000..ee3739f97 --- /dev/null +++ b/tests/ui/consts/const-enum-vector.rs @@ -0,0 +1,15 @@ +// run-pass + +enum E { V1(isize), V0 } +static C: [E; 3] = [E::V0, E::V1(0xDEADBEE), E::V0]; + +pub fn main() { + match C[1] { + E::V1(n) => assert_eq!(n, 0xDEADBEE), + _ => panic!() + } + match C[2] { + E::V0 => (), + _ => panic!() + } +} -- cgit v1.2.3