]>
git.proxmox.com Git - rustc.git/blob - tests/ui/borrowck/borrowck-move-out-from-array.rs
1 fn array() -> [(String
, String
); 3] {
5 // Const Index + Const Index
7 fn move_out_from_begin_and_end() {
10 let [.., _y
] = a
; //~ ERROR [E0382]
13 fn move_out_from_begin_field_and_end() {
15 let [_
, _
, (_x
, _
)] = a
;
16 let [.., _y
] = a
; //~ ERROR [E0382]
19 fn move_out_from_begin_field_and_end_field() {
21 let [_
, _
, (_x
, _
)] = a
;
22 let [.., (_y
, _
)] = a
; //~ ERROR [E0382]
25 // Const Index + Slice
27 fn move_out_by_const_index_and_subslice() {
30 let [_y @
.., _
, _
] = a
; //~ ERROR [E0382]
33 fn move_out_by_const_index_end_and_subslice() {
36 let [_
, _
, _y @
..] = a
; //~ ERROR [E0382]
39 fn move_out_by_const_index_field_and_subslice() {
41 let [(_x
, _
), _
, _
] = a
;
42 let [_y @
.., _
, _
] = a
; //~ ERROR [E0382]
45 fn move_out_by_const_index_end_field_and_subslice() {
47 let [.., (_x
, _
)] = a
;
48 let [_
, _
, _y @
..] = a
; //~ ERROR [E0382]
51 fn move_out_by_subslice_and_const_index_field() {
53 let [_y @
.., _
, _
] = a
;
54 let [(_x
, _
), _
, _
] = a
; //~ ERROR [E0382]
57 fn move_out_by_subslice_and_const_index_end_field() {
59 let [_
, _
, _y @
..] = a
;
60 let [.., (_x
, _
)] = a
; //~ ERROR [E0382]
65 fn move_out_by_subslice_and_subslice() {
68 let [_
, _y @
..] = a
; //~ ERROR [E0382]