]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/box_expr.main.ElaborateDrops.before.mir
Rollup merge of #88659 - est31:update_smallvec_name, r=matthewjasper
[rust.git] / src / test / 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:6:11: 6:11
5     let _1: std::boxed::Box<S>;          // in scope 0 at $DIR/box_expr.rs:7:9: 7:10
6     let mut _2: std::boxed::Box<S>;      // in scope 0 at $DIR/box_expr.rs:7:13: 7:25
7     let _3: ();                          // in scope 0 at $DIR/box_expr.rs:8:5: 8:12
8     let mut _4: std::boxed::Box<S>;      // in scope 0 at $DIR/box_expr.rs:8:10: 8:11
9     scope 1 {
10         debug x => _1;                   // in scope 1 at $DIR/box_expr.rs:7:9: 7:10
11     }
12
13     bb0: {
14         StorageLive(_1);                 // scope 0 at $DIR/box_expr.rs:7:9: 7:10
15         StorageLive(_2);                 // scope 0 at $DIR/box_expr.rs:7:13: 7:25
16         _2 = Box(S);                     // scope 0 at $DIR/box_expr.rs:7:13: 7:25
17         (*_2) = S::new() -> [return: bb1, unwind: bb7]; // scope 0 at $DIR/box_expr.rs:7:17: 7:25
18                                          // mir::Constant
19                                          // + span: $DIR/box_expr.rs:7:17: 7:23
20                                          // + literal: Const { ty: fn() -> S {S::new}, val: Value(Scalar(<ZST>)) }
21     }
22
23     bb1: {
24         _1 = move _2;                    // scope 0 at $DIR/box_expr.rs:7:13: 7:25
25         drop(_2) -> bb2;                 // scope 0 at $DIR/box_expr.rs:7:24: 7:25
26     }
27
28     bb2: {
29         StorageDead(_2);                 // scope 0 at $DIR/box_expr.rs:7:24: 7:25
30         StorageLive(_3);                 // scope 1 at $DIR/box_expr.rs:8:5: 8:12
31         StorageLive(_4);                 // scope 1 at $DIR/box_expr.rs:8:10: 8:11
32         _4 = move _1;                    // scope 1 at $DIR/box_expr.rs:8:10: 8:11
33         _3 = std::mem::drop::<Box<S>>(move _4) -> [return: bb3, unwind: bb5]; // scope 1 at $DIR/box_expr.rs:8:5: 8:12
34                                          // mir::Constant
35                                          // + span: $DIR/box_expr.rs:8:5: 8:9
36                                          // + literal: Const { ty: fn(std::boxed::Box<S>) {std::mem::drop::<std::boxed::Box<S>>}, val: Value(Scalar(<ZST>)) }
37     }
38
39     bb3: {
40         StorageDead(_4);                 // scope 1 at $DIR/box_expr.rs:8:11: 8:12
41         StorageDead(_3);                 // scope 1 at $DIR/box_expr.rs:8:12: 8:13
42         _0 = const ();                   // scope 0 at $DIR/box_expr.rs:6:11: 9:2
43         drop(_1) -> bb4;                 // scope 0 at $DIR/box_expr.rs:9:1: 9:2
44     }
45
46     bb4: {
47         StorageDead(_1);                 // scope 0 at $DIR/box_expr.rs:9:1: 9:2
48         return;                          // scope 0 at $DIR/box_expr.rs:9:2: 9:2
49     }
50
51     bb5 (cleanup): {
52         drop(_4) -> bb6;                 // scope 1 at $DIR/box_expr.rs:8:11: 8:12
53     }
54
55     bb6 (cleanup): {
56         drop(_1) -> bb8;                 // scope 0 at $DIR/box_expr.rs:9:1: 9:2
57     }
58
59     bb7 (cleanup): {
60         drop(_2) -> bb8;                 // scope 0 at $DIR/box_expr.rs:7:24: 7:25
61     }
62
63     bb8 (cleanup): {
64         resume;                          // scope 0 at $DIR/box_expr.rs:6:1: 9:2
65     }
66 }