summaryrefslogtreecommitdiffstats
path: root/tests/ui/pattern/range-pattern-meant-to-be-slice-rest-pattern.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/pattern/range-pattern-meant-to-be-slice-rest-pattern.rs')
-rw-r--r--tests/ui/pattern/range-pattern-meant-to-be-slice-rest-pattern.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ui/pattern/range-pattern-meant-to-be-slice-rest-pattern.rs b/tests/ui/pattern/range-pattern-meant-to-be-slice-rest-pattern.rs
new file mode 100644
index 000000000..a619fcafc
--- /dev/null
+++ b/tests/ui/pattern/range-pattern-meant-to-be-slice-rest-pattern.rs
@@ -0,0 +1,9 @@
+fn main() {
+ match &[1, 2, 3][..] {
+ [1, rest..] => println!("{rest:?}"),
+ //~^ ERROR cannot find value `rest` in this scope
+ //~| ERROR cannot find value `rest` in this scope
+ //~| ERROR `X..` patterns in slices are experimental
+ _ => {}
+ }
+}