fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
3.4 KiB71 linesraw
1// MIR for `main` after ConstProp
2
3fn main() -> () {
4    let mut _0: ();                      // return place in scope 0 at $DIR/const_allocation.rs:7:11: 7:11
5    let _1: &[(std::option::Option<i32>, &[&str])]; // in scope 0 at $DIR/const_allocation.rs:8:5: 8:8
6    let mut _2: &&[(std::option::Option<i32>, &[&str])]; // in scope 0 at $DIR/const_allocation.rs:8:5: 8:8
7
8    bb0: {
9        StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/const_allocation.rs:8:5: 8:8
10        StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/const_allocation.rs:8:5: 8:8
11        _2 = const {alloc0+0: &&[(std::option::Option<i32>, &[&str])]}; // bb0[2]: scope 0 at $DIR/const_allocation.rs:8:5: 8:8
12                                         // ty::Const
13                                         // + ty: &&[(std::option::Option<i32>, &[&str])]
14                                         // + val: Value(Scalar(alloc0+0))
15                                         // mir::Constant
16                                         // + span: $DIR/const_allocation.rs:8:5: 8:8
17                                         // + literal: Const { ty: &&[(std::option::Option<i32>, &[&str])], val: Value(Scalar(alloc0+0)) }
18        _1 = (*_2);                      // bb0[3]: scope 0 at $DIR/const_allocation.rs:8:5: 8:8
19        StorageDead(_2);                 // bb0[4]: scope 0 at $DIR/const_allocation.rs:8:8: 8:9
20        StorageDead(_1);                 // bb0[5]: scope 0 at $DIR/const_allocation.rs:8:8: 8:9
21        _0 = const ();                   // bb0[6]: scope 0 at $DIR/const_allocation.rs:7:11: 9:2
22                                         // ty::Const
23                                         // + ty: ()
24                                         // + val: Value(Scalar(<ZST>))
25                                         // mir::Constant
26                                         // + span: $DIR/const_allocation.rs:7:11: 9:2
27                                         // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
28        return;                          // bb0[7]: scope 0 at $DIR/const_allocation.rs:9:2: 9:2
29    }
30}
31
32alloc0 (static: FOO, size: 8, align: 4) {
33    ╾alloc17+0╼ 03 00 00 00                         │ ╾──╼....
34}
35
36alloc17 (size: 48, align: 4) {
37    0x00 │ 00 00 00 00 __ __ __ __ ╾alloc4+0─╼ 00 00 00 00 │ ....░░░░╾──╼....
38    0x10 │ 00 00 00 00 __ __ __ __ ╾alloc8+0─╼ 02 00 00 00 │ ....░░░░╾──╼....
39    0x20 │ 01 00 00 00 2a 00 00 00 ╾alloc13+0╼ 03 00 00 00 │ ....*...╾──╼....
40}
41
42alloc4 (size: 0, align: 4) {}
43
44alloc8 (size: 16, align: 4) {
45    ╾alloc7+0─╼ 03 00 00 00 ╾alloc9+0─╼ 03 00 00 00 │ ╾──╼....╾──╼....
46}
47
48alloc7 (size: 3, align: 1) {
49    66 6f 6f                                        │ foo
50}
51
52alloc9 (size: 3, align: 1) {
53    62 61 72                                        │ bar
54}
55
56alloc13 (size: 24, align: 4) {
57    0x00 │ ╾alloc12+0╼ 03 00 00 00 ╾alloc14+0╼ 03 00 00 00 │ ╾──╼....╾──╼....
58    0x10 │ ╾alloc15+0╼ 04 00 00 00                         │ ╾──╼....
59}
60
61alloc12 (size: 3, align: 1) {
62    6d 65 68                                        │ meh
63}
64
65alloc14 (size: 3, align: 1) {
66    6d 6f 70                                        │ mop
67}
68
69alloc15 (size: 4, align: 1) {
70    6d c3 b6 70                                     │ m..p
71}