2018-02-24 13:21:33 -06:00
|
|
|
#![feature(box_syntax)]
|
2018-01-31 14:34:13 -06:00
|
|
|
|
2022-09-04 22:00:31 -05:00
|
|
|
// EMIT_MIR uniform_array_move_out.move_out_from_end.built.after.mir
|
2018-01-31 14:34:13 -06:00
|
|
|
fn move_out_from_end() {
|
|
|
|
let a = [box 1, box 2];
|
|
|
|
let [.., _y] = a;
|
|
|
|
}
|
|
|
|
|
2022-09-04 22:00:31 -05:00
|
|
|
// EMIT_MIR uniform_array_move_out.move_out_by_subslice.built.after.mir
|
2018-01-31 14:34:13 -06:00
|
|
|
fn move_out_by_subslice() {
|
|
|
|
let a = [box 1, box 2];
|
2019-07-07 18:47:46 -05:00
|
|
|
let [_y @ ..] = a;
|
2018-01-31 14:34:13 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
move_out_by_subslice();
|
|
|
|
move_out_from_end();
|
|
|
|
}
|