]> git.proxmox.com Git - rustc.git/blame - 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
CommitLineData
353b0b11 1#![feature(stmt_expr_attributes, rustc_attrs)]
0531ce1d 2
487cf647 3// EMIT_MIR uniform_array_move_out.move_out_from_end.built.after.mir
0531ce1d 4fn move_out_from_end() {
353b0b11
FG
5 let a = [
6 #[rustc_box]
7 Box::new(1),
8 #[rustc_box]
9 Box::new(2),
10 ];
0531ce1d
XL
11 let [.., _y] = a;
12}
13
487cf647 14// EMIT_MIR uniform_array_move_out.move_out_by_subslice.built.after.mir
0531ce1d 15fn move_out_by_subslice() {
353b0b11
FG
16 let a = [
17 #[rustc_box]
18 Box::new(1),
19 #[rustc_box]
20 Box::new(2),
21 ];
416331ca 22 let [_y @ ..] = a;
0531ce1d
XL
23}
24
25fn main() {
26 move_out_by_subslice();
27 move_out_from_end();
28}