]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/inline/cycle.main.Inline.diff
Rollup merge of #99084 - RalfJung:write_bytes, r=thomcc
[rust.git] / src / test / mir-opt / inline / cycle.main.Inline.diff
1 - // MIR for `main` before Inline
2 + // MIR for `main` after Inline
3   
4   fn main() -> () {
5       let mut _0: ();                      // return place in scope 0 at $DIR/cycle.rs:16:11: 16:11
6       let _1: ();                          // in scope 0 at $DIR/cycle.rs:17:5: 17:9
7 +     let mut _2: fn() {g};                // in scope 0 at $DIR/cycle.rs:17:5: 17:9
8 +     scope 1 (inlined f::<fn() {g}>) {    // at $DIR/cycle.rs:17:5: 17:9
9 +         debug g => _2;                   // in scope 1 at $DIR/cycle.rs:5:6: 5:7
10 +         let _3: ();                      // in scope 1 at $DIR/cycle.rs:6:5: 6:8
11 +         let mut _4: &fn() {g};           // in scope 1 at $DIR/cycle.rs:6:5: 6:6
12 +         let mut _5: ();                  // in scope 1 at $DIR/cycle.rs:6:5: 6:8
13 +         scope 2 (inlined <fn() {g} as Fn<()>>::call - shim(fn() {g})) { // at $DIR/cycle.rs:6:5: 6:8
14 +             scope 3 (inlined g) {        // at $SRC_DIR/core/src/ops/function.rs:LL:COL
15 +                 let mut _6: fn() {main}; // in scope 3 at $DIR/cycle.rs:12:5: 12:12
16 +                 scope 4 (inlined f::<fn() {main}>) { // at $DIR/cycle.rs:12:5: 12:12
17 +                     debug g => _6;       // in scope 4 at $DIR/cycle.rs:5:6: 5:7
18 +                     let _7: ();          // in scope 4 at $DIR/cycle.rs:6:5: 6:8
19 +                     let mut _8: &fn() {main}; // in scope 4 at $DIR/cycle.rs:6:5: 6:6
20 +                     scope 5 (inlined <fn() {main} as Fn<()>>::call - shim(fn() {main})) { // at $DIR/cycle.rs:6:5: 6:8
21 +                     }
22 +                 }
23 +             }
24 +         }
25 +     }
26   
27       bb0: {
28           StorageLive(_1);                 // scope 0 at $DIR/cycle.rs:17:5: 17:9
29 -         _1 = f::<fn() {g}>(g) -> bb1;    // scope 0 at $DIR/cycle.rs:17:5: 17:9
30 +         StorageLive(_2);                 // scope 0 at $DIR/cycle.rs:17:5: 17:9
31 +         _2 = g;                          // scope 0 at $DIR/cycle.rs:17:5: 17:9
32                                            // mir::Constant
33 -                                          // + span: $DIR/cycle.rs:17:5: 17:6
34 -                                          // + literal: Const { ty: fn(fn() {g}) {f::<fn() {g}>}, val: Value(<ZST>) }
35 -                                          // mir::Constant
36                                            // + span: $DIR/cycle.rs:17:7: 17:8
37                                            // + literal: Const { ty: fn() {g}, val: Value(<ZST>) }
38 +         StorageLive(_3);                 // scope 1 at $DIR/cycle.rs:6:5: 6:8
39 +         StorageLive(_4);                 // scope 1 at $DIR/cycle.rs:6:5: 6:6
40 +         _4 = &_2;                        // scope 1 at $DIR/cycle.rs:6:5: 6:6
41 +         StorageLive(_5);                 // scope 1 at $DIR/cycle.rs:6:5: 6:8
42 +         StorageLive(_6);                 // scope 3 at $DIR/cycle.rs:12:5: 12:12
43 +         StorageLive(_7);                 // scope 4 at $DIR/cycle.rs:6:5: 6:8
44 +         StorageLive(_8);                 // scope 4 at $DIR/cycle.rs:6:5: 6:6
45 +         _8 = &_6;                        // scope 4 at $DIR/cycle.rs:6:5: 6:6
46 +         _7 = move (*_8)() -> [return: bb4, unwind: bb2]; // scope 5 at $SRC_DIR/core/src/ops/function.rs:LL:COL
47       }
48   
49       bb1: {
50 +         StorageDead(_2);                 // scope 0 at $DIR/cycle.rs:17:5: 17:9
51           StorageDead(_1);                 // scope 0 at $DIR/cycle.rs:17:9: 17:10
52           _0 = const ();                   // scope 0 at $DIR/cycle.rs:16:11: 18:2
53           return;                          // scope 0 at $DIR/cycle.rs:18:2: 18:2
54 +     }
55
56 +     bb2 (cleanup): {
57 +         drop(_2) -> bb3;                 // scope 1 at $DIR/cycle.rs:7:1: 7:2
58 +     }
59
60 +     bb3 (cleanup): {
61 +         resume;                          // scope 1 at $DIR/cycle.rs:5:1: 7:2
62 +     }
63
64 +     bb4: {
65 +         StorageDead(_8);                 // scope 4 at $DIR/cycle.rs:6:7: 6:8
66 +         StorageDead(_7);                 // scope 4 at $DIR/cycle.rs:6:8: 6:9
67 +         StorageDead(_6);                 // scope 3 at $DIR/cycle.rs:12:5: 12:12
68 +         StorageDead(_5);                 // scope 1 at $DIR/cycle.rs:6:7: 6:8
69 +         StorageDead(_4);                 // scope 1 at $DIR/cycle.rs:6:7: 6:8
70 +         StorageDead(_3);                 // scope 1 at $DIR/cycle.rs:6:8: 6:9
71 +         drop(_2) -> bb1;                 // scope 1 at $DIR/cycle.rs:7:1: 7:2
72       }
73   }
74