summaryrefslogtreecommitdiffstats
path: root/src/test/ui/borrowck/borrowck-move-out-from-array.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
commita4b7ed7a42c716ab9f05e351f003d589124fd55d (patch)
treeb620cd3f223850b28716e474e80c58059dca5dd4 /src/test/ui/borrowck/borrowck-move-out-from-array.rs
parentAdding upstream version 1.67.1+dfsg1. (diff)
downloadrustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.tar.xz
rustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.zip
Adding upstream version 1.68.2+dfsg1.upstream/1.68.2+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/borrowck/borrowck-move-out-from-array.rs')
-rw-r--r--src/test/ui/borrowck/borrowck-move-out-from-array.rs71
1 files changed, 0 insertions, 71 deletions
diff --git a/src/test/ui/borrowck/borrowck-move-out-from-array.rs b/src/test/ui/borrowck/borrowck-move-out-from-array.rs
deleted file mode 100644
index 83755812f..000000000
--- a/src/test/ui/borrowck/borrowck-move-out-from-array.rs
+++ /dev/null
@@ -1,71 +0,0 @@
-fn array() -> [(String, String); 3] {
- Default::default()
-}
-
-// Const Index + Const Index
-
-fn move_out_from_begin_and_end() {
- let a = array();
- let [_, _, _x] = a;
- let [.., _y] = a; //~ ERROR [E0382]
-}
-
-fn move_out_from_begin_field_and_end() {
- let a = array();
- let [_, _, (_x, _)] = a;
- let [.., _y] = a; //~ ERROR [E0382]
-}
-
-fn move_out_from_begin_field_and_end_field() {
- let a = array();
- let [_, _, (_x, _)] = a;
- let [.., (_y, _)] = a; //~ ERROR [E0382]
-}
-
-// Const Index + Slice
-
-fn move_out_by_const_index_and_subslice() {
- let a = array();
- let [_x, _, _] = a;
- let [_y @ .., _, _] = a; //~ ERROR [E0382]
-}
-
-fn move_out_by_const_index_end_and_subslice() {
- let a = array();
- let [.., _x] = a;
- let [_, _, _y @ ..] = a; //~ ERROR [E0382]
-}
-
-fn move_out_by_const_index_field_and_subslice() {
- let a = array();
- let [(_x, _), _, _] = a;
- let [_y @ .., _, _] = a; //~ ERROR [E0382]
-}
-
-fn move_out_by_const_index_end_field_and_subslice() {
- let a = array();
- let [.., (_x, _)] = a;
- let [_, _, _y @ ..] = a; //~ ERROR [E0382]
-}
-
-fn move_out_by_subslice_and_const_index_field() {
- let a = array();
- let [_y @ .., _, _] = a;
- let [(_x, _), _, _] = a; //~ ERROR [E0382]
-}
-
-fn move_out_by_subslice_and_const_index_end_field() {
- let a = array();
- let [_, _, _y @ ..] = a;
- let [.., (_x, _)] = a; //~ ERROR [E0382]
-}
-
-// Slice + Slice
-
-fn move_out_by_subslice_and_subslice() {
- let a = array();
- let [x @ .., _] = a;
- let [_, _y @ ..] = a; //~ ERROR [E0382]
-}
-
-fn main() {}