]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/const_prop/boxes.main.ConstProp.diff
Rollup merge of #98387 - NobodyXu:feature/std_io_Error_try_downgrade_inner, r=yaahc
[rust.git] / src / test / mir-opt / const_prop / boxes.main.ConstProp.diff
1 - // MIR for `main` before ConstProp
2 + // MIR for `main` after ConstProp
3   
4   fn main() -> () {
5       let mut _0: ();                      // return place in scope 0 at $DIR/boxes.rs:11:11: 11:11
6       let _1: i32;                         // in scope 0 at $DIR/boxes.rs:12:9: 12:10
7       let mut _2: i32;                     // in scope 0 at $DIR/boxes.rs:12:13: 12:22
8       let mut _3: std::boxed::Box<i32>;    // in scope 0 at $DIR/boxes.rs:12:14: 12:22
9       let mut _4: usize;                   // in scope 0 at $DIR/boxes.rs:12:14: 12:22
10       let mut _5: usize;                   // in scope 0 at $DIR/boxes.rs:12:14: 12:22
11       let mut _6: *mut u8;                 // in scope 0 at $DIR/boxes.rs:12:14: 12:22
12       let mut _7: std::boxed::Box<i32>;    // in scope 0 at $DIR/boxes.rs:12:14: 12:22
13       let mut _8: *const i32;              // in scope 0 at $DIR/boxes.rs:12:14: 12:22
14       let mut _9: *const i32;              // in scope 0 at $DIR/boxes.rs:12:14: 12:22
15       let mut _10: *const i32;             // in scope 0 at $DIR/boxes.rs:12:14: 12:22
16       let mut _11: *const i32;             // in scope 0 at $DIR/boxes.rs:12:14: 12:22
17       scope 1 {
18           debug x => _1;                   // in scope 1 at $DIR/boxes.rs:12:9: 12:10
19       }
20       scope 2 {
21       }
22   
23       bb0: {
24           StorageLive(_1);                 // scope 0 at $DIR/boxes.rs:12:9: 12:10
25           StorageLive(_2);                 // scope 0 at $DIR/boxes.rs:12:13: 12:22
26           StorageLive(_3);                 // scope 0 at $DIR/boxes.rs:12:14: 12:22
27 -         _4 = SizeOf(i32);                // scope 2 at $DIR/boxes.rs:12:14: 12:22
28 -         _5 = AlignOf(i32);               // scope 2 at $DIR/boxes.rs:12:14: 12:22
29 -         _6 = alloc::alloc::exchange_malloc(move _4, move _5) -> bb1; // scope 2 at $DIR/boxes.rs:12:14: 12:22
30 +         _4 = const 4_usize;              // scope 2 at $DIR/boxes.rs:12:14: 12:22
31 +         _5 = const 4_usize;              // scope 2 at $DIR/boxes.rs:12:14: 12:22
32 +         _6 = alloc::alloc::exchange_malloc(const 4_usize, const 4_usize) -> bb1; // scope 2 at $DIR/boxes.rs:12:14: 12:22
33                                            // mir::Constant
34                                            // + span: $DIR/boxes.rs:12:14: 12:22
35                                            // + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(<ZST>) }
36       }
37   
38       bb1: {
39           StorageLive(_7);                 // scope 0 at $DIR/boxes.rs:12:14: 12:22
40           _7 = ShallowInitBox(move _6, i32); // scope 0 at $DIR/boxes.rs:12:14: 12:22
41           StorageLive(_8);                 // scope 0 at $DIR/boxes.rs:12:19: 12:21
42           _8 = (((_7.0: std::ptr::Unique<i32>).0: std::ptr::NonNull<i32>).0: *const i32); // scope 0 at $DIR/boxes.rs:12:19: 12:21
43           (*_8) = const 42_i32;            // scope 0 at $DIR/boxes.rs:12:19: 12:21
44           StorageDead(_8);                 // scope 0 at $DIR/boxes.rs:12:14: 12:22
45           _3 = move _7;                    // scope 0 at $DIR/boxes.rs:12:14: 12:22
46           StorageDead(_7);                 // scope 0 at $DIR/boxes.rs:12:21: 12:22
47           StorageLive(_9);                 // scope 0 at $DIR/boxes.rs:12:13: 12:22
48           _9 = (((_3.0: std::ptr::Unique<i32>).0: std::ptr::NonNull<i32>).0: *const i32); // scope 0 at $DIR/boxes.rs:12:13: 12:22
49           _2 = (*_9);                      // scope 0 at $DIR/boxes.rs:12:13: 12:22
50           StorageDead(_9);                 // scope 0 at $DIR/boxes.rs:12:13: 12:26
51           _1 = Add(move _2, const 0_i32);  // scope 0 at $DIR/boxes.rs:12:13: 12:26
52           StorageDead(_2);                 // scope 0 at $DIR/boxes.rs:12:25: 12:26
53           drop(_3) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/boxes.rs:12:26: 12:27
54       }
55   
56       bb2: {
57           StorageDead(_3);                 // scope 0 at $DIR/boxes.rs:12:26: 12:27
58           nop;                             // scope 0 at $DIR/boxes.rs:11:11: 13:2
59           StorageDead(_1);                 // scope 0 at $DIR/boxes.rs:13:1: 13:2
60           return;                          // scope 0 at $DIR/boxes.rs:13:2: 13:2
61       }
62   
63       bb3 (cleanup): {
64           resume;                          // scope 0 at $DIR/boxes.rs:11:1: 13:2
65       }
66   }
67