]> git.lizzy.rs Git - rust.git/blob - tests/mir-opt/box_expr.main.ElaborateDrops.before.mir
Rollup merge of #106446 - bzEq:fix-unwind-lsda, r=Amanieu
[rust.git] / tests / mir-opt / box_expr.main.ElaborateDrops.before.mir
1 // MIR for `main` before ElaborateDrops
2
3 fn main() -> () {
4     let mut _0: ();                      // return place in scope 0 at $DIR/box_expr.rs:+0:11: +0:11
5     let _1: std::boxed::Box<S>;          // in scope 0 at $DIR/box_expr.rs:+1:9: +1:10
6     let mut _2: usize;                   // in scope 0 at $DIR/box_expr.rs:+1:13: +1:25
7     let mut _3: usize;                   // in scope 0 at $DIR/box_expr.rs:+1:13: +1:25
8     let mut _4: *mut u8;                 // in scope 0 at $DIR/box_expr.rs:+1:13: +1:25
9     let mut _5: std::boxed::Box<S>;      // in scope 0 at $DIR/box_expr.rs:+1:13: +1:25
10     let _6: ();                          // in scope 0 at $DIR/box_expr.rs:+2:5: +2:12
11     let mut _7: std::boxed::Box<S>;      // in scope 0 at $DIR/box_expr.rs:+2:10: +2:11
12     scope 1 {
13         debug x => _1;                   // in scope 1 at $DIR/box_expr.rs:+1:9: +1:10
14     }
15     scope 2 {
16     }
17
18     bb0: {
19         StorageLive(_1);                 // scope 0 at $DIR/box_expr.rs:+1:9: +1:10
20         _2 = SizeOf(S);                  // scope 2 at $DIR/box_expr.rs:+1:13: +1:25
21         _3 = AlignOf(S);                 // scope 2 at $DIR/box_expr.rs:+1:13: +1:25
22         _4 = alloc::alloc::exchange_malloc(move _2, move _3) -> bb1; // scope 2 at $DIR/box_expr.rs:+1:13: +1:25
23                                          // mir::Constant
24                                          // + span: $DIR/box_expr.rs:7:13: 7:25
25                                          // + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(<ZST>) }
26     }
27
28     bb1: {
29         StorageLive(_5);                 // scope 0 at $DIR/box_expr.rs:+1:13: +1:25
30         _5 = ShallowInitBox(move _4, S); // scope 0 at $DIR/box_expr.rs:+1:13: +1:25
31         (*_5) = S::new() -> [return: bb2, unwind: bb8]; // scope 0 at $DIR/box_expr.rs:+1:17: +1:25
32                                          // mir::Constant
33                                          // + span: $DIR/box_expr.rs:7:17: 7:23
34                                          // + literal: Const { ty: fn() -> S {S::new}, val: Value(<ZST>) }
35     }
36
37     bb2: {
38         _1 = move _5;                    // scope 0 at $DIR/box_expr.rs:+1:13: +1:25
39         drop(_5) -> bb3;                 // scope 0 at $DIR/box_expr.rs:+1:24: +1:25
40     }
41
42     bb3: {
43         StorageDead(_5);                 // scope 0 at $DIR/box_expr.rs:+1:24: +1:25
44         StorageLive(_6);                 // scope 1 at $DIR/box_expr.rs:+2:5: +2:12
45         StorageLive(_7);                 // scope 1 at $DIR/box_expr.rs:+2:10: +2:11
46         _7 = move _1;                    // scope 1 at $DIR/box_expr.rs:+2:10: +2:11
47         _6 = std::mem::drop::<Box<S>>(move _7) -> [return: bb4, unwind: bb6]; // scope 1 at $DIR/box_expr.rs:+2:5: +2:12
48                                          // mir::Constant
49                                          // + span: $DIR/box_expr.rs:8:5: 8:9
50                                          // + literal: Const { ty: fn(Box<S>) {std::mem::drop::<Box<S>>}, val: Value(<ZST>) }
51     }
52
53     bb4: {
54         StorageDead(_7);                 // scope 1 at $DIR/box_expr.rs:+2:11: +2:12
55         StorageDead(_6);                 // scope 1 at $DIR/box_expr.rs:+2:12: +2:13
56         _0 = const ();                   // scope 0 at $DIR/box_expr.rs:+0:11: +3:2
57         drop(_1) -> bb5;                 // scope 0 at $DIR/box_expr.rs:+3:1: +3:2
58     }
59
60     bb5: {
61         StorageDead(_1);                 // scope 0 at $DIR/box_expr.rs:+3:1: +3:2
62         return;                          // scope 0 at $DIR/box_expr.rs:+3:2: +3:2
63     }
64
65     bb6 (cleanup): {
66         drop(_7) -> bb7;                 // scope 1 at $DIR/box_expr.rs:+2:11: +2:12
67     }
68
69     bb7 (cleanup): {
70         drop(_1) -> bb9;                 // scope 0 at $DIR/box_expr.rs:+3:1: +3:2
71     }
72
73     bb8 (cleanup): {
74         drop(_5) -> bb9;                 // scope 0 at $DIR/box_expr.rs:+1:24: +1:25
75     }
76
77     bb9 (cleanup): {
78         resume;                          // scope 0 at $DIR/box_expr.rs:+0:1: +3:2
79     }
80 }