summaryrefslogtreecommitdiffstats
path: root/tests/ui/pattern/usefulness/match-slice-patterns.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/pattern/usefulness/match-slice-patterns.rs')
-rw-r--r--tests/ui/pattern/usefulness/match-slice-patterns.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/pattern/usefulness/match-slice-patterns.rs b/tests/ui/pattern/usefulness/match-slice-patterns.rs
new file mode 100644
index 000000000..92d74b8c2
--- /dev/null
+++ b/tests/ui/pattern/usefulness/match-slice-patterns.rs
@@ -0,0 +1,12 @@
+fn check(list: &[Option<()>]) {
+ match list {
+ //~^ ERROR `&[_, Some(_), .., None, _]` not covered
+ &[] => {},
+ &[_] => {},
+ &[_, _] => {},
+ &[_, None, ..] => {},
+ &[.., Some(_), _] => {},
+ }
+}
+
+fn main() {}