summaryrefslogtreecommitdiffstats
path: root/tests/ui/rfcs/rfc-2005-default-binding-mode/slice.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
commitdc0db358abe19481e475e10c32149b53370f1a1c (patch)
treeab8ce99c4b255ce46f99ef402c27916055b899ee /tests/ui/rfcs/rfc-2005-default-binding-mode/slice.rs
parentReleasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff)
downloadrustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz
rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--tests/ui/rfcs/rfc-2005-default-binding-mode/slice.rs26
1 files changed, 4 insertions, 22 deletions
diff --git a/tests/ui/rfcs/rfc-2005-default-binding-mode/slice.rs b/tests/ui/rfcs/rfc-2005-default-binding-mode/slice.rs
index 33229a205..363a0e3e6 100644
--- a/tests/ui/rfcs/rfc-2005-default-binding-mode/slice.rs
+++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/slice.rs
@@ -1,25 +1,7 @@
-// run-pass
-
-fn slice_pat() {
+pub fn main() {
let sl: &[u8] = b"foo";
- match sl {
- [first, remainder @ ..] => {
- let _: &u8 = first;
- assert_eq!(first, &b'f');
- assert_eq!(remainder, b"oo");
- }
- [] => panic!(),
- }
-}
-
-fn slice_pat_omission() {
- match &[0, 1, 2] {
- [..] => {}
- };
-}
-
-fn main() {
- slice_pat();
- slice_pat_omission();
+ match sl { //~ ERROR non-exhaustive patterns
+ [first, remainder @ ..] => {},
+ };
}