From: Pierre-Emmanuel Patry Date: Wed, 1 Mar 2023 10:36:42 +0000 (+0100) Subject: gccrs: testsuite: Add a test for .. in slice patterns X-Git-Tag: basepoints/gcc-15~2816 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d17c95a05210ecf4437eb97261b7f97de4383b8b;p=thirdparty%2Fgcc.git gccrs: testsuite: Add a test for .. in slice patterns Add a test to check wether the syntax of a RestPattern in a SlicePattern parse correctly. gcc/testsuite/ChangeLog: * rust/compile/slice_rest_pattern.rs: New test. Signed-off-by: Pierre-Emmanuel Patry --- diff --git a/gcc/testsuite/rust/compile/slice_rest_pattern.rs b/gcc/testsuite/rust/compile/slice_rest_pattern.rs new file mode 100644 index 000000000000..c27a8dd777e4 --- /dev/null +++ b/gcc/testsuite/rust/compile/slice_rest_pattern.rs @@ -0,0 +1,8 @@ +// { dg-options "-fsyntax-only" } +fn foo(a: &[u32]) { + match a { + [first, ..] => {} + [.., last] => {} + _ => {} + } +}