1 #![feature(slice_patterns)]
3 fn array() -> [(String, String); 3] {
7 // Const Index + Const Index
9 fn move_out_from_begin_and_end() {
12 let [.., ref _y] = a; //~ ERROR [E0382]
15 fn move_out_from_begin_field_and_end() {
17 let [_, _, (_x, _)] = a;
18 let [.., ref _y] = a; //~ ERROR [E0382]
21 fn move_out_from_begin_field_and_end_field() {
23 let [_, _, (_x, _)] = a;
24 let [.., (ref _y, _)] = a; //~ ERROR [E0382]
27 // Const Index + Slice
29 fn move_out_by_const_index_and_subslice() {
32 let [ref _y @ .., _, _] = a; //~ ERROR [E0382]
35 fn move_out_by_const_index_end_and_subslice() {
38 let [_, _, ref _y @ ..] = a; //~ ERROR [E0382]
41 fn move_out_by_const_index_field_and_subslice() {
43 let [(_x, _), _, _] = a;
44 let [ref _y @ .., _, _] = a; //~ ERROR [E0382]
47 fn move_out_by_const_index_end_field_and_subslice() {
49 let [.., (_x, _)] = a;
50 let [_, _, ref _y @ ..] = a; //~ ERROR [E0382]
53 fn move_out_by_subslice_and_const_index_field() {
55 let [_y @ .., _, _] = a;
56 let [(ref _x, _), _, _] = a; //~ ERROR [E0382]
59 fn move_out_by_subslice_and_const_index_end_field() {
61 let [_, _, _y @ ..] = a;
62 let [.., (ref _x, _)] = a; //~ ERROR [E0382]
67 fn move_out_by_subslice_and_subslice() {
70 let [_, ref _y @ ..] = a; //~ ERROR [E0382]
75 fn move_out_and_assign_end() {
78 a[2] = Default::default(); //~ ERROR [E0382]
81 fn move_out_and_assign_end_field() {
83 let [_, _, (_x, _)] = a;
84 a[2].1 = Default::default(); //~ ERROR [E0382]
87 fn move_out_slice_and_assign_end() {
89 let [_, _, _x @ ..] = a;
90 a[0] = Default::default(); //~ ERROR [E0382]
93 fn move_out_slice_and_assign_end_field() {
95 let [_, _, _x @ ..] = a;
96 a[0].1 = Default::default(); //~ ERROR [E0382]