]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-move-out-from-array.rs
Simplify SaveHandler trait
[rust.git] / src / test / ui / borrowck / borrowck-move-out-from-array.rs
1 #![feature(box_syntax)]
2 #![feature(slice_patterns)]
3
4 fn move_out_from_begin_and_end() {
5     let a = [box 1, box 2];
6     let [_, _x] = a;
7     let [.., _y] = a; //~ ERROR [E0382]
8 }
9
10 fn move_out_by_const_index_and_subslice() {
11     let a = [box 1, box 2];
12     let [_x, _] = a;
13     let [_y..] = a; //~ ERROR [E0382]
14 }
15
16 fn main() {}