blob: d587d237227ad0b632ff5b64ea4f541ce2182eb3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#![feature(box_syntax)]
fn move_out_from_end() {
let a = [box 1, box 2];
let [.., _y] = a;
}
fn move_out_by_subslice() {
let a = [box 1, box 2];
let [_y @ ..] = a;
}
fn main() {
move_out_by_subslice();
move_out_from_end();
}
// END RUST SOURCE
// START rustc.move_out_from_end.mir_map.0.mir
// _6 = move _1[1 of 2];
// _0 = ();
// END rustc.move_out_from_end.mir_map.0.mir
// START rustc.move_out_by_subslice.mir_map.0.mir
// _6 = move _1[0..2];
// _0 = ();
// END rustc.move_out_by_subslice.mir_map.0.mir
|