about summary refs log tree commit diff
path: root/src/test/ui/pattern/usefulness/match-byte-array-patterns-2.rs
diff options
context:
space:
mode:
authorNadrieril <nadrieril@gmail.com>2019-09-28 16:05:38 +0200
committerNadrieril <nadrieril@gmail.com>2019-10-27 21:20:26 +0000
commit09f9947ebc68a8199c3dff8607a41571c48cc377 (patch)
treefb81c258de9902ea813c24c5ca08bcce9817a4bb /src/test/ui/pattern/usefulness/match-byte-array-patterns-2.rs
parent0f677c65e867d93a47ccbaeaf6e6725cde8c5ff6 (diff)
downloadrust-09f9947ebc68a8199c3dff8607a41571c48cc377.tar.gz
rust-09f9947ebc68a8199c3dff8607a41571c48cc377.zip
Gather together usefulness tests
I took most tests that were testing only for match exhaustiveness,
pattern refutability or match arm reachability, and put them in
the same test folder.
Diffstat (limited to 'src/test/ui/pattern/usefulness/match-byte-array-patterns-2.rs')
-rw-r--r--src/test/ui/pattern/usefulness/match-byte-array-patterns-2.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/ui/pattern/usefulness/match-byte-array-patterns-2.rs b/src/test/ui/pattern/usefulness/match-byte-array-patterns-2.rs
new file mode 100644
index 00000000000..33468d03fae
--- /dev/null
+++ b/src/test/ui/pattern/usefulness/match-byte-array-patterns-2.rs
@@ -0,0 +1,13 @@
+fn main() {
+    let buf = &[0, 1, 2, 3];
+
+    match buf { //~ ERROR non-exhaustive
+        b"AAAA" => {}
+    }
+
+    let buf: &[u8] = buf;
+
+    match buf { //~ ERROR non-exhaustive
+        b"AAAA" => {}
+    }
+}