]> git.proxmox.com Git - rustc.git/blob - tests/mir-opt/building/uniform_array_move_out.rs
New upstream version 1.70.0+dfsg1
[rustc.git] / tests / mir-opt / building / uniform_array_move_out.rs
1 #![feature(stmt_expr_attributes, rustc_attrs)]
2
3 // EMIT_MIR uniform_array_move_out.move_out_from_end.built.after.mir
4 fn move_out_from_end() {
5 let a = [
6 #[rustc_box]
7 Box::new(1),
8 #[rustc_box]
9 Box::new(2),
10 ];
11 let [.., _y] = a;
12 }
13
14 // EMIT_MIR uniform_array_move_out.move_out_by_subslice.built.after.mir
15 fn move_out_by_subslice() {
16 let a = [
17 #[rustc_box]
18 Box::new(1),
19 #[rustc_box]
20 Box::new(2),
21 ];
22 let [_y @ ..] = a;
23 }
24
25 fn main() {
26 move_out_by_subslice();
27 move_out_from_end();
28 }