2018-02-24 22:21:33 +03:00
|
|
|
#![feature(box_syntax)]
|
|
|
|
#![feature(slice_patterns)]
|
2018-01-31 23:34:13 +03:00
|
|
|
|
|
|
|
fn move_out_from_begin_and_end() {
|
|
|
|
let a = [box 1, box 2];
|
|
|
|
let [_, _x] = a;
|
2019-04-22 08:40:08 +01:00
|
|
|
let [.., _y] = a; //~ ERROR [E0382]
|
2018-01-31 23:34:13 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
fn move_out_by_const_index_and_subslice() {
|
|
|
|
let a = [box 1, box 2];
|
|
|
|
let [_x, _] = a;
|
2019-07-08 01:47:46 +02:00
|
|
|
let [_y @ ..] = a; //~ ERROR [E0382]
|
2018-01-31 23:34:13 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|